MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / IsInitialBlockDownload

Function IsInitialBlockDownload

src/main.cpp:1634–1655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1632
1633bool fForceInitialBlockDownload = false;
1634bool IsInitialBlockDownload()
1635{
1636 if (fForceInitialBlockDownload)
1637 return false;
1638
1639 const CChainParams& chainParams = Params();
1640 LOCK(cs_main);
1641 if (fImporting || fReindex)
1642 return true;
1643 if (fCheckpointsEnabled && chainActive.Height() < Checkpoints::GetTotalBlocksEstimate(chainParams.Checkpoints()))
1644 return true;
1645 static bool lockIBDState = false;
1646 if (lockIBDState)
1647 return false;
1648 bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
1649 std::max(chainActive.Tip()->GetBlockTime(), pindexBestHeader->GetBlockTime()) < GetTime() - 24 * 60 * 60);
1650 if (!state) {
1651 lockIBDState = true;
1652 LogPrintf("No longer initial block download\n");
1653 }
1654 return state;
1655}
1656
1657bool fLargeWorkForkFound = false;
1658bool fLargeWorkInvalidChainFound = false;

Callers 14

BitcoinMinerFunction · 0.85
getblocktemplateFunction · 0.85
operator()Method · 0.85
AcceptToMemoryPoolFunction · 0.85
UpdateTipFunction · 0.85
ConnectTipFunction · 0.85
ActivateBestChainFunction · 0.85
ThinBlocksActiveFunction · 0.85
ProcessMessageFunction · 0.85
WillDownloadFromNodeFunction · 0.85

Calls 6

GetTotalBlocksEstimateFunction · 0.85
GetTimeFunction · 0.85
HeightMethod · 0.80
ParamsClass · 0.70
GetBlockTimeMethod · 0.45
TipMethod · 0.45

Tested by

no test coverage detected