File tree 1 file changed +4
-2
lines changed 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -499,6 +499,10 @@ impl Mempool {
499
499
. chain_err ( || "failed to update mempool from daemon" ) ?;
500
500
let to_remove: HashSet < & Txid > = old_txids. difference ( & new_txids) . collect ( ) ;
501
501
502
+ // 2. Remove missing transactions. Even if we are unable to download new transactions from
503
+ // the daemon, we still want to remove the transactions that are no longer in the mempool.
504
+ mempool. write ( ) . unwrap ( ) . remove ( to_remove) ;
505
+
502
506
// 2. Download the new transactions from the daemon's mempool
503
507
let txids: Vec < & Txid > = new_txids. difference ( & old_txids) . collect ( ) ;
504
508
let to_add = daemon
@@ -510,8 +514,6 @@ impl Mempool {
510
514
let mut mempool = mempool. write ( ) . unwrap ( ) ;
511
515
// Add new transactions
512
516
mempool. add ( to_add) ;
513
- // Remove missing transactions
514
- mempool. remove ( to_remove) ;
515
517
516
518
mempool
517
519
. count
You can’t perform that action at this time.
0 commit comments