Skip to content

Commit b859361

Browse files
author
MarcoFalke
committed
Merge bitcoin#21775: p2p: Limit m_block_inv_mutex
fac96d0 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 fac96d0 jnewbery: utACK fac96d0 theStack: Code-Review ACK fac96d0 Tree-SHA512: fcfac0f1f8b16df7522513abf716b2eed3d2fc9153f231c8cb61f451e342f29c984a5c872deca6bab3e601e5d651874cc229146c9370e46811b4520747a21f2b
2 parents 320e518 + fac96d0 commit b859361

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/net_processing.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4449,8 +4449,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
44494449
}
44504450
}
44514451
peer->m_blocks_for_inv_relay.clear();
4452+
}
44524453

4453-
if (pto->m_tx_relay != nullptr) {
4454+
if (pto->m_tx_relay != nullptr) {
44544455
LOCK(pto->m_tx_relay->cs_tx_inventory);
44554456
// Check whether periodic sends should happen
44564457
bool fSendTrickle = pto->HasPermission(PF_NOBAN);
@@ -4578,7 +4579,6 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
45784579
}
45794580
}
45804581
}
4581-
}
45824582
}
45834583
if (!vInv.empty())
45844584
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));

0 commit comments

Comments
 (0)