aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-11-11 10:34:31 -0500
committerJohn Newbery <john@johnnewbery.com>2020-03-11 18:38:27 -0400
commit1168394d759b13af68acec6d5bfa04aaa24561f8 (patch)
treefbc098f8a571d4b005195cfa88d2f86603726451 /src/txmempool.cpp
parenteae48ec84c4deacfe92139d07ee80e51136cb766 (diff)
downloadbitcoin-1168394d759b13af68acec6d5bfa04aaa24561f8.tar.xz
[wallet] Notify conflicted transactions in TransactionRemovedFromMempool
The only CValidationInterface client that cares about transactions that are removed from the mempool because of CONFLICT is the wallet. Start using the TransactionRemovedFromMempool method to notify about conflicted transactions instead of using the vtxConflicted vector in BlockConnected.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 5768219f3a..f04f13e6e0 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -408,7 +408,11 @@ void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
{
CTransactionRef ptx = it->GetSharedTx();
NotifyEntryRemoved(ptx, reason);
- if (reason != MemPoolRemovalReason::BLOCK && reason != MemPoolRemovalReason::CONFLICT) {
+ if (reason != MemPoolRemovalReason::BLOCK) {
+ // Notify clients that a transaction has been removed from the mempool
+ // for any reason except being included in a block. Clients interested
+ // in transactions included in blocks can subscribe to the BlockConnected
+ // notification.
GetMainSignals().TransactionRemovedFromMempool(ptx);
}