aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-07-24 17:27:49 -0400
committerAntoine Riard <ariard@student.42.fr>2019-07-24 19:47:56 -0400
commit9bc8b28c1d26c28edf4bbc890be97c0ad7a73cb9 (patch)
treed2ac6d3dedad0d2773273ccaf838161840957cc5 /src/node
parent0626b8cbdf0aa971500eb5613c7ab4096c496966 (diff)
refactor : use RelayTransaction in BroadcastTransaction utility
To do so, we also refactor RelayTransaction to take a txid instead of passing a tx
Diffstat (limited to 'src/node')
-rw-r--r--src/node/transaction.cpp6
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;
}