mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-03 22:03:01 +01:00
Fix potential deadlock
Conflict: * cs_main in ProcessMessages() (before calling ProcessMessages) * cs_vSend in CNode::BeginMessage versus: * cs_vSend in ThreadMessageHandler2 (before calling SendMessages) * cs_main in SendMessages Even though cs_vSend is a try_lock, if it succeeds simultaneously with the locking of cs_main in ProcessMessages(), it could cause a deadlock.
This commit is contained in:
committed by
Luke Dashjr
parent
7f34351910
commit
dc588faf59
@@ -2618,7 +2618,7 @@ bool ProcessMessages(CNode* pfrom)
|
||||
|
||||
bool SendMessages(CNode* pto, bool fSendTrickle)
|
||||
{
|
||||
CRITICAL_BLOCK(cs_main)
|
||||
TRY_CRITICAL_BLOCK(cs_main)
|
||||
{
|
||||
// Don't send anything until we get their version message
|
||||
if (pto->nVersion == 0)
|
||||
|
||||
Reference in New Issue
Block a user