mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: add is_empty check before read lock (#4507)
This commit is contained in:
@ -660,6 +660,9 @@ where
|
||||
|
||||
/// Removes all transactions that are present in the pool.
|
||||
pub(crate) fn retain_unknown(&self, hashes: &mut Vec<TxHash>) {
|
||||
if hashes.is_empty() {
|
||||
return
|
||||
}
|
||||
let pool = self.pool.read();
|
||||
hashes.retain(|tx| !pool.contains(tx))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user