diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-05-03 11:13:38 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-05-03 11:13:41 +0200 |
commit | b8593616dc2ab5b8f81edd8b2408d400e3b696cd (patch) | |
tree | acd254f757328cee41236fc7d58095b873578974 /src | |
parent | 320e518b9062ea5510abd7876d22dc5bd3352535 (diff) | |
parent | fac96d026511f22f0202ce3631a38be0e990555f (diff) |
Merge bitcoin/bitcoin#21775: p2p: Limit m_block_inv_mutex
fac96d026511f22f0202ce3631a38be0e990555f p2p: Limit m_block_inv_mutex (MarcoFalke)
Pull request description:
Keeping the lock longer than needed is confusing to reviewers and thread analysis. For example, keeping the lock while appending tx-invs, which requires the mempool lock, will tell thread analysis tools an incorrect lock order of `(1) m_block_inv_mutex, (2) pool.cs`.
ACKs for top commit:
Crypt-iQ:
crACK fac96d026511f22f0202ce3631a38be0e990555f
jnewbery:
utACK fac96d026511f22f0202ce3631a38be0e990555f
theStack:
Code-Review ACK fac96d026511f22f0202ce3631a38be0e990555f
Tree-SHA512: fcfac0f1f8b16df7522513abf716b2eed3d2fc9153f231c8cb61f451e342f29c984a5c872deca6bab3e601e5d651874cc229146c9370e46811b4520747a21f2b
Diffstat (limited to 'src')
-rw-r--r-- | src/net_processing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 2201caf7d2..2d625331a6 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -4449,8 +4449,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto) } } peer->m_blocks_for_inv_relay.clear(); + } - if (pto->m_tx_relay != nullptr) { + if (pto->m_tx_relay != nullptr) { LOCK(pto->m_tx_relay->cs_tx_inventory); // Check whether periodic sends should happen bool fSendTrickle = pto->HasPermission(PF_NOBAN); @@ -4578,7 +4579,6 @@ bool PeerManagerImpl::SendMessages(CNode* pto) } } } - } } if (!vInv.empty()) m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv)); |