Nit: The callback_set variable seems unnecessary now.
0diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
1index 05450299e5..0b6213f7fd 100644
2--- a/src/node/transaction.cpp
3+++ b/src/node/transaction.cpp
4@@ -45,7 +45,6 @@ TransactionError BroadcastTransaction(NodeContext& node,
5
6 Txid txid = tx->GetHash();
7 Wtxid wtxid = tx->GetWitnessHash();
8- bool callback_set = false;
9
10 {
11 LOCK(cs_main);
12@@ -102,22 +101,19 @@ TransactionError BroadcastTransaction(NodeContext& node,
13 }
14 break;
15 }
16-
17- if (wait_callback && node.validation_signals) {
18- // For transactions broadcast from outside the wallet, make sure
19- // that the wallet has been notified of the transaction before
20- // continuing.
21- //
22- // This prevents a race where a user might call sendrawtransaction
23- // with a transaction to/from their wallet, immediately call some
24- // wallet RPC, and get a stale result because callbacks have not
25- // yet been processed.
26- callback_set = true;
27- }
28 }
29 } // cs_main
30
31- if (callback_set) {
32+ if (wait_callback && node.validation_signals) {
33+ // For transactions broadcast from outside the wallet, make sure
34+ // that the wallet has been notified of the transaction before
35+ // continuing.
36+ //
37+ // This prevents a race where a user might call sendrawtransaction
38+ // with a transaction to/from their wallet, immediately call some
39+ // wallet RPC, and get a stale result because callbacks have not
40+ // yet been processed.
41+
42 // Wait until Validation Interface clients have been notified of the
43 // transaction entering the mempool.
44 node.validation_signals->SyncWithValidationInterfaceQueue();