mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
Lock cs_vSend and cs_inventory in a consistent order even in TRY
This commit is contained in:
parent
1c2edd9f67
commit
fd13eca147
@ -1069,15 +1069,16 @@ void CConnman::ThreadSocketHandler()
|
||||
if (pnode->GetRefCount() <= 0)
|
||||
{
|
||||
bool fDelete = false;
|
||||
{
|
||||
TRY_LOCK(pnode->cs_vSend, lockSend);
|
||||
if (lockSend)
|
||||
{
|
||||
TRY_LOCK(pnode->cs_inventory, lockInv);
|
||||
if (lockInv)
|
||||
{
|
||||
TRY_LOCK(pnode->cs_vSend, lockSend);
|
||||
if (lockSend) {
|
||||
fDelete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fDelete)
|
||||
{
|
||||
vNodesDisconnected.remove(pnode);
|
||||
|
Loading…
x
Reference in New Issue
Block a user