mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
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
This commit is contained in:
parent
23b83109ea
commit
334496ea7e
@ -5642,6 +5642,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
peer->m_blocks_for_inv_relay.clear();
|
peer->m_blocks_for_inv_relay.clear();
|
||||||
|
}
|
||||||
|
|
||||||
auto queueAndMaybePushInv = [this, pto, peer, &vInv, &msgMaker](const CInv& invIn) {
|
auto queueAndMaybePushInv = [this, pto, peer, &vInv, &msgMaker](const CInv& invIn) {
|
||||||
AssertLockHeld(peer->m_tx_relay->m_tx_inventory_mutex);
|
AssertLockHeld(peer->m_tx_relay->m_tx_inventory_mutex);
|
||||||
@ -5770,7 +5771,6 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Send non-tx/non-block inventory items
|
// Send non-tx/non-block inventory items
|
||||||
LOCK2(peer->m_tx_relay->m_tx_inventory_mutex, peer->m_tx_relay->m_bloom_filter_mutex);
|
LOCK2(peer->m_tx_relay->m_tx_inventory_mutex, peer->m_tx_relay->m_bloom_filter_mutex);
|
||||||
@ -5791,7 +5791,6 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
|
|||||||
}
|
}
|
||||||
peer->m_tx_relay->vInventoryOtherToSend.clear();
|
peer->m_tx_relay->vInventoryOtherToSend.clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!vInv.empty())
|
if (!vInv.empty())
|
||||||
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));
|
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user