diff options
author | fanquake <fanquake@gmail.com> | 2021-03-18 14:25:27 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-03-18 14:57:50 +0800 |
commit | e057e01b7b7bf537c2f3b23bb56821e7c0e5a24c (patch) | |
tree | 788d6d5f2521bc914a0441925c219fe24a154f63 /src/node | |
parent | bf7c22f7ff83c1e16dfbc1496bdd5d278ccee2d9 (diff) | |
parent | 680eb56d828ce358b4e000c140f5b247ff5e6179 (diff) |
Merge #21162: Net Processing: Move RelayTransaction() into PeerManager
680eb56d828ce358b4e000c140f5b247ff5e6179 [net processing] Don't pass CConnman to RelayTransactions (John Newbery)
a38a4e8f039dfabfd9435f3a63f1a9b56de086d6 [net processing] Move RelayTransaction into PeerManager (John Newbery)
Pull request description:
This is the first part of #21160. It moves the RelayTransaction() function to be a member function of the PeerManager class. This is required in order to move the transaction inventory data into the Peer object, since Peer objects are only accessible from within PeerManager.
ACKs for top commit:
ajtowns:
ACK 680eb56d828ce358b4e000c140f5b247ff5e6179
Tree-SHA512: 8c93491a4392b6369bb7f090de326a63cd62a088de59026e202f226f64ded50a0cf1a95ed703328860f02a9d2f64d3a87ca1bca9a6075b978bd111d384766235
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/transaction.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index 97763f4fa2..f47e85aceb 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -29,9 +29,9 @@ static TransactionError HandleATMPError(const TxValidationState& state, std::str TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef tx, std::string& err_string, const CAmount& max_tx_fee, bool relay, bool wait_callback) { // BroadcastTransaction can be called by either sendrawtransaction RPC or wallet RPCs. - // node.connman is assigned both before chain clients and before RPC server is accepting calls, - // and reset after chain clients and RPC sever are stopped. node.connman should never be null here. - assert(node.connman); + // node.peerman is assigned both before chain clients and before RPC server is accepting calls, + // and reset after chain clients and RPC sever are stopped. node.peerman should never be null here. + assert(node.peerman); assert(node.mempool); std::promise<void> promise; uint256 hashTx = tx->GetHash(); @@ -101,7 +101,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t node.mempool->AddUnbroadcastTx(hashTx); LOCK(cs_main); - RelayTransaction(hashTx, tx->GetWitnessHash(), *node.connman); + node.peerman->RelayTransaction(hashTx, tx->GetWitnessHash()); } return TransactionError::OK; |