MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / InvalidChainFound

Function InvalidChainFound

src/validation.cpp:1327–1347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1325}
1326
1327void static InvalidChainFound(CBlockIndex* pindexNew)
1328{
1329 if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork)
1330 pindexBestInvalid = pindexNew;
1331
1332 // If the invalid chain found is supposed to be finalized, we need to move
1333 // back the finalization point.
1334 if (IsBlockFinalized(pindexNew)) {
1335 pindexFinalized = pindexNew->pprev;
1336 }
1337
1338 LogPrintf("%s: invalid block=%s height=%d log2_work=%.8g date=%s\n", __func__,
1339 pindexNew->GetBlockHash().ToString(), pindexNew->nHeight,
1340 log(pindexNew->nChainWork.getdouble())/log(2.0), FormatISO8601DateTime(pindexNew->GetBlockTime()));
1341 CBlockIndex *tip = chainActive.Tip();
1342 assert (tip);
1343 LogPrintf("%s: current best=%s height=%d log2_work=%.8g date=%s\n", __func__,
1344 tip->GetBlockHash().ToString(), chainActive.Height(), log(tip->nChainWork.getdouble())/log(2.0),
1345 FormatISO8601DateTime(tip->GetBlockTime()));
1346 CheckForkWarningConditions();
1347}
1348
1349void CChainState::InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state) {
1350 if (!state.CorruptionPossible()) {

Callers 4

InvalidBlockFoundMethod · 0.85
FindMostWorkChainMethod · 0.85
ActivateBestChainStepMethod · 0.85
InvalidateBlockMethod · 0.85

Calls 9

IsBlockFinalizedFunction · 0.85
FormatISO8601DateTimeFunction · 0.85
getdoubleMethod · 0.80
HeightMethod · 0.80
ToStringMethod · 0.45
GetBlockHashMethod · 0.45
GetBlockTimeMethod · 0.45
TipMethod · 0.45

Tested by

no test coverage detected