diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1507,25 +1507,14 @@ auto locked_chain = chain().lock(); LOCK(cs_wallet); - // TODO: Temporarily ensure that mempool removals are notified before - // connected transactions. This shouldn't matter, but the abandoned state of - // transactions in our wallet is currently cleared when we receive another - // notification and there is a race condition where notification of a - // connected conflict might cause an outside process to abandon a - // transaction and then have it inadvertently cleared by the notification - // that the conflicted transaction was evicted. - for (const CTransactionRef &ptx : vtxConflicted) { - SyncTransaction(ptx, CWalletTx::Status::CONFLICTED, - BlockHash() /* block hash */, - 0 /* position in block */); - TransactionRemovedFromMempool(ptx); - } - for (size_t i = 0; i < block.vtx.size(); i++) { SyncTransaction(block.vtx[i], CWalletTx::Status::CONFIRMED, block_hash, i); TransactionRemovedFromMempool(block.vtx[i]); } + for (const CTransactionRef &ptx : vtxConflicted) { + TransactionRemovedFromMempool(ptx); + } m_last_block_processed = block_hash; }