mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
refactor : use RelayTransaction in BroadcastTransaction utility
To do so, we also refactor RelayTransaction to take a txid instead of passing a tx
This commit is contained in:
parent
0626b8cbdf
commit
9bc8b28c1d
4 changed files with 13 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue