aboutsummaryrefslogtreecommitdiff
path: root/src/node/transaction.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2020-01-29 08:12:59 -0800
committerAmiti Uttarwar <amiti@uttarwar.org>2020-04-23 14:42:25 -0700
commit89eeb4a3335f8e871cc3f5286af4546dff66172a (patch)
tree6705d43114fbd4a7d308c10a9f3ef27c0556c81f /src/node/transaction.cpp
parent23991ee53af21c2fdc28f6e8e002dc1455c71098 (diff)
[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 201406ce3b..3841d8687d 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);
}