From 9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9 Mon Sep 17 00:00:00 2001 From: Antoine Riard Date: Wed, 24 Jul 2019 17:27:49 -0400 Subject: refactor : use RelayTransaction in BroadcastTransaction utility To do so, we also refactor RelayTransaction to take a txid instead of passing a tx --- src/node/transaction.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/node') 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 #include +#include #include #include #include @@ -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; } -- cgit v1.2.3