aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
Diffstat (limited to 'src/node')
-rw-r--r--src/node/transaction.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index f21b390915..926dd0e31d 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -71,6 +71,12 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
// Transaction was accepted to the mempool.
+ if (relay) {
+ // the mempool tracks locally submitted transactions to make a
+ // best-effort of initial broadcast
+ node.mempool->AddUnbroadcastTx(hashTx);
+ }
+
if (wait_callback) {
// For transactions broadcast from outside the wallet, make sure
// that the wallet has been notified of the transaction before
@@ -96,9 +102,6 @@ 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);
node.peerman->RelayTransaction(hashTx, tx->GetWitnessHash());
}