mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-17 18:40:09 +00:00
IsInitialBlockDownload no longer uses header-only timestamps.
This avoids a corner case (mostly visible on testnet) where bogus headers can keep nodes in IsInitialBlockDownload.
This commit is contained in:
parent
2082b5574c
commit
e141beb6a9
@ -1744,11 +1744,10 @@ bool IsInitialBlockDownload()
|
||||
return true;
|
||||
if (chainActive.Tip()->nChainWork < UintToArith256(chainParams.GetConsensus().nMinimumChainWork))
|
||||
return true;
|
||||
bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
|
||||
std::max(chainActive.Tip()->GetBlockTime(), pindexBestHeader->GetBlockTime()) < GetTime() - nMaxTipAge);
|
||||
if (!state)
|
||||
latchToFalse.store(true, std::memory_order_relaxed);
|
||||
return state;
|
||||
if (chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))
|
||||
return true;
|
||||
latchToFalse.store(true, std::memory_order_relaxed);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fLargeWorkForkFound = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user