aboutsummaryrefslogtreecommitdiff
path: root/src/node/transaction.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <[email protected]>2020-01-29 08:12:59 -0800
committerAmiti Uttarwar <[email protected]>2020-04-23 14:42:25 -0700
commit89eeb4a3335f8e871cc3f5286af4546dff66172a (patch)
tree6705d43114fbd4a7d308c10a9f3ef27c0556c81f /src/node/transaction.cpp
parentMerge #15600: lockedpool: When possible, use madvise to avoid including sensi... (diff)
downloaddiscoin-89eeb4a3335f8e871cc3f5286af4546dff66172a.tar.xz
discoin-89eeb4a3335f8e871cc3f5286af4546dff66172a.zip
[mempool] Track "unbroadcast" transactions
- Mempool tracks locally submitted transactions (wallet or rpc) - Transactions are removed from set when the node receives a GETDATA request from a peer, or if the transaction is removed from the mempool.
Diffstat (limited to 'src/node/transaction.cpp')
-rw-r--r--src/node/transaction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index 201406ce3..3841d8687 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -78,6 +78,10 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
}
if (relay) {
+ // the mempool tracks locally submitted transactions to make a
+ // best-effort of initial broadcast
+ node.mempool->AddUnbroadcastTx(hashTx);
+
RelayTransaction(hashTx, *node.connman);
}