mirror of
https://github.com/romanz/electrs.git
synced 2025-02-24 06:57:53 +01:00
[mempool] Fix bug on removing entries
Fixes issue where old mempool entires were only removed if new ones were also added.
This commit is contained in:
parent
878f81cfeb
commit
af227013f1
1 changed files with 12 additions and 13 deletions
|
@ -213,9 +213,7 @@ impl Tracker {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
if entries.is_empty() {
|
if !entries.is_empty() {
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let txids: Vec<&Sha256dHash> = entries.iter().map(|(txid, _)| *txid).collect();
|
let txids: Vec<&Sha256dHash> = entries.iter().map(|(txid, _)| *txid).collect();
|
||||||
let txs = match daemon.gettransactions(&txids) {
|
let txs = match daemon.gettransactions(&txids) {
|
||||||
Ok(txs) => txs,
|
Ok(txs) => txs,
|
||||||
|
@ -228,6 +226,7 @@ impl Tracker {
|
||||||
assert_eq!(tx.txid(), *txid);
|
assert_eq!(tx.txid(), *txid);
|
||||||
self.add(txid, tx, entry);
|
self.add(txid, tx, entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
timer.observe_duration();
|
timer.observe_duration();
|
||||||
|
|
||||||
let timer = self.stats.start_timer("remove");
|
let timer = self.stats.start_timer("remove");
|
||||||
|
|
Loading…
Add table
Reference in a new issue