diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-07-31 10:49:21 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-07-31 10:49:28 -0400 |
commit | 7821821a23b68cc9ec49d69829ad4c939cb762e8 (patch) | |
tree | f3ea3769265808d173807a708d268b744f0fff75 /src/node | |
parent | 3f288a1c05ebcadd7d7709f81c77921ff9e27ba2 (diff) | |
parent | 9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9 (diff) |
Merge #16452: refactor: use RelayTransaction in BroadcastTransaction utility
9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9 refactor : use RelayTransaction in BroadcastTransaction utility (Antoine Riard)
Pull request description:
Implementing suggestion in https://github.com/bitcoin/bitcoin/pull/15713#discussion_r306571420.
Seems a reason of these node utilities is to glue with already there functions, so we should reuse them.
ACKs for top commit:
MarcoFalke:
ACK 9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9
promag:
ACK 9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9, verified there are no more `PushInventory(CInv(MSG_TX, ...`, nice refactor, :+1: @amitiuttarwar.
jnewbery:
ACK 9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9
jonatack:
ACK 9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9, second @jnewbery's suggestions, my guess is they could be added without risking delaying this PR.
Tree-SHA512: 841c65d5f0d9ead5380814bb2260d7ebf03f2a9bfa58a1025785d353bdb42f9122cc257993e6a7bd2bd3f2c74db19c5978cc14be0d83258124ca22e33d6d0164
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/transaction.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index 5ffb15ed3c..5cd567a5c4 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -5,6 +5,7 @@ #include <consensus/validation.h> #include <net.h> +#include <net_processing.h> #include <txmempool.h> #include <util/validation.h> #include <validation.h> @@ -69,10 +70,7 @@ TransactionError BroadcastTransaction(const CTransactionRef tx, uint256& hashTx, return TransactionError::P2P_DISABLED; } - CInv inv(MSG_TX, hashTx); - g_connman->ForEachNode([&inv](CNode* pnode) { - pnode->PushInventory(inv); - }); + RelayTransaction(hashTx, *g_connman); return TransactionError::OK; } |