aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-07-31 10:49:21 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-07-31 10:49:28 -0400
commit7821821a23b68cc9ec49d69829ad4c939cb762e8 (patch)
treef3ea3769265808d173807a708d268b744f0fff75 /src/interfaces
parent3f288a1c05ebcadd7d7709f81c77921ff9e27ba2 (diff)
parent9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9 (diff)
downloadbitcoin-7821821a23b68cc9ec49d69829ad4c939cb762e8.tar.xz
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/interfaces')
-rw-r--r--src/interfaces/chain.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 02f39cef8e..22e4aaedaf 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -9,6 +9,7 @@
#include <interfaces/handler.h>
#include <interfaces/wallet.h>
#include <net.h>
+#include <net_processing.h>
#include <node/coin.h>
#include <policy/fees.h>
#include <policy/policy.h>
@@ -292,8 +293,7 @@ public:
}
void relayTransaction(const uint256& txid) override
{
- CInv inv(MSG_TX, txid);
- g_connman->ForEachNode([&inv](CNode* node) { node->PushInventory(inv); });
+ RelayTransaction(txid, *g_connman);
}
void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) override
{