mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
chainlocks: Relay clsig inv only after bestChainLock(Hash) are assigned (#3990)
Fixes a race condidion when we might reply with `notfound` to other nodes because we might still be waiting for locks here.
This commit is contained in:
parent
ebea362d06
commit
77e9a4a83b
@ -135,13 +135,13 @@ void CChainLocksHandler::ProcessNewChainLock(const NodeId from, const llmq::CCha
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_connman->RelayInv(clsigInv, LLMQS_PROTO_VERSION);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, cs);
|
LOCK2(cs_main, cs);
|
||||||
bestChainLockHash = hash;
|
bestChainLockHash = hash;
|
||||||
bestChainLock = clsig;
|
bestChainLock = clsig;
|
||||||
|
|
||||||
|
g_connman->RelayInv(clsigInv, LLMQS_PROTO_VERSION);
|
||||||
|
|
||||||
const CBlockIndex* pindex = LookupBlockIndex(clsig.blockHash);
|
const CBlockIndex* pindex = LookupBlockIndex(clsig.blockHash);
|
||||||
if (!pindex) {
|
if (!pindex) {
|
||||||
// we don't know the block/header for this CLSIG yet, so bail out for now
|
// we don't know the block/header for this CLSIG yet, so bail out for now
|
||||||
|
Loading…
Reference in New Issue
Block a user