mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
chainlocks: Fix potential deadlock (#3972)
Should fix this: ``` Previous lock order was: pnode->cs_sendProcessing net.cpp:2854 cs_main net_processing.cpp:3946 (TRY) mempool.cs net_processing.cpp:4183 (1) pto->cs_inventory net_processing.cpp:4183 pto->cs_filter net_processing.cpp:4233 (2) cs llmq/quorums_chainlocks.cpp:87 Current lock order is: cs_main llmq/quorums_chainlocks.cpp:138 (2) cs llmq/quorums_chainlocks.cpp:138 cs_vNodes net.cpp:3662 (1) cs_inventory ./net.h:1085 ```
This commit is contained in:
parent
7099dea2e4
commit
7c5710f64b
@ -135,7 +135,7 @@ void CChainLocksHandler::ProcessNewChainLock(NodeId from, const llmq::CChainLock
|
||||
}
|
||||
|
||||
{
|
||||
LOCK2(cs_main, cs);
|
||||
LOCK(cs);
|
||||
|
||||
if (InternalHasConflictingChainLock(clsig.nHeight, clsig.blockHash)) {
|
||||
// This should not happen. If it happens, it means that a malicious entity controls a large part of the MN
|
||||
@ -144,13 +144,16 @@ void CChainLocksHandler::ProcessNewChainLock(NodeId from, const llmq::CChainLock
|
||||
__func__, clsig.ToString(), bestChainLock.ToString(), from);
|
||||
return;
|
||||
}
|
||||
|
||||
bestChainLockHash = hash;
|
||||
bestChainLock = clsig;
|
||||
}
|
||||
|
||||
CInv inv(MSG_CLSIG, hash);
|
||||
g_connman->RelayInv(inv, LLMQS_PROTO_VERSION);
|
||||
|
||||
{
|
||||
LOCK2(cs_main, cs);
|
||||
bestChainLockHash = hash;
|
||||
bestChainLock = clsig;
|
||||
|
||||
const CBlockIndex* pindex = LookupBlockIndex(clsig.blockHash);
|
||||
if (!pindex) {
|
||||
// we don't know the block/header for this CLSIG yet, so bail out for now
|
||||
|
Loading…
Reference in New Issue
Block a user