mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge bitcoin/bitcoin#21845: net processing: Don't require locking cs_main before calling RelayTransactions()
39e19713cd[net processing] Add internal _RelayTransactions() (John Newbery) Pull request description: As part of the general effort to reduce cs_main usage in net_processing, this removes the need to be holding `cs_main` when calling `RelayTransactions()` from outside net_processing. Internally, we lock `cs_main` and call an internal `_RelayTransactions()` function that _does_ require `cs_main`. ACKs for top commit: MarcoFalke: re-unsigned-code-review ACK39e19713cdpromag: Code review ACK39e19713cd, just included sync.h since last review. ajtowns: ACK39e19713cdTree-SHA512: dc08441233adfb8eaac501cf497cb4bad029eb723bd3fa8a3d8b7e49cc984c98859b95780ad15f5701d62ac745a8223beb0df405e3d49d95a8c86c8be17c9543
This commit is contained in:
@@ -100,8 +100,6 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
|
||||
// the mempool tracks locally submitted transactions to make a
|
||||
// best-effort of initial broadcast
|
||||
node.mempool->AddUnbroadcastTx(hashTx);
|
||||
|
||||
LOCK(cs_main);
|
||||
node.peerman->RelayTransaction(hashTx, tx->GetWitnessHash());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user