mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: return empty vec if input vec is empty (#4906)
This commit is contained in:
@ -650,6 +650,9 @@ where
|
|||||||
&self,
|
&self,
|
||||||
hashes: Vec<TxHash>,
|
hashes: Vec<TxHash>,
|
||||||
) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
|
) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
|
||||||
|
if hashes.is_empty() {
|
||||||
|
return Vec::new()
|
||||||
|
}
|
||||||
let removed = self.pool.write().remove_transactions(hashes);
|
let removed = self.pool.write().remove_transactions(hashes);
|
||||||
|
|
||||||
let mut listener = self.event_listener.write();
|
let mut listener = self.event_listener.write();
|
||||||
@ -692,6 +695,9 @@ where
|
|||||||
&self,
|
&self,
|
||||||
txs: Vec<TxHash>,
|
txs: Vec<TxHash>,
|
||||||
) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
|
) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
|
||||||
|
if txs.is_empty() {
|
||||||
|
return Vec::new()
|
||||||
|
}
|
||||||
self.pool.read().get_all(txs).collect()
|
self.pool.read().get_all(txs).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user