diff options
author | fanquake <fanquake@gmail.com> | 2021-05-07 10:58:26 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-05-07 11:11:05 +0800 |
commit | a0d1d487e93d238304f3e1e2df097b0fa190a54b (patch) | |
tree | e3fbd8e4f607dd1a1bb4988063c16f76f788ee91 /src/node | |
parent | 06d573f053c63eb6521c62d210c5924418ae2b83 (diff) | |
parent | 39e19713cd6594f93db835e8ef7eef5824a9ba02 (diff) |
Merge bitcoin/bitcoin#21845: net processing: Don't require locking cs_main before calling RelayTransactions()
39e19713cd6594f93db835e8ef7eef5824a9ba02 [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 ACK 39e19713cd6594f93db835e8ef7eef5824a9ba02
promag:
Code review ACK 39e19713cd6594f93db835e8ef7eef5824a9ba02, just included sync.h since last review.
ajtowns:
ACK 39e19713cd6594f93db835e8ef7eef5824a9ba02
Tree-SHA512: dc08441233adfb8eaac501cf497cb4bad029eb723bd3fa8a3d8b7e49cc984c98859b95780ad15f5701d62ac745a8223beb0df405e3d49d95a8c86c8be17c9543
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/transaction.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp index 691b2791d7..a1e7a71e2c 100644 --- a/src/node/transaction.cpp +++ b/src/node/transaction.cpp @@ -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()); } |