Skip to content

Commit 77e9a4a

Browse files
authored
chainlocks: Relay clsig inv only after bestChainLock(Hash) are assigned (dashpay#3990)
Fixes a race condidion when we might reply with `notfound` to other nodes because we might still be waiting for locks here.
1 parent ebea362 commit 77e9a4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/llmq/quorums_chainlocks.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ void CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq::CCha
135135
return;
136136
}
137137

138-
g_connman->RelayInv(clsigInv, LLMQS_PROTO_VERSION);
139-
140138
{
141139
LOCK2(cs_main, cs);
142140
bestChainLockHash = hash;
143141
bestChainLock = clsig;
144142

143+
g_connman->RelayInv(clsigInv, LLMQS_PROTO_VERSION);
144+
145145
const CBlockIndex* pindex = LookupBlockIndex(clsig.blockHash);
146146
if (!pindex) {
147147
// we don't know the block/header for this CLSIG yet, so bail out for now

0 commit comments

Comments
 (0)