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

Function InvalidChainFound

src/main.cpp:499–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499void static InvalidChainFound(CBlockIndex *pIndexNew) {
500 if (pIndexBestInvalid == nullptr || pIndexNew->height > pIndexBestInvalid->height) {
501 pIndexBestInvalid = pIndexNew;
502 // The current code doesn't actually read the BestInvalidWork entry in
503 // the block database anymore, as it is derived from the flags in block
504 // index entry. We only write it for backward compatibility.
505 // TODO: need to remove the indexBestInvalid
506 //pCdMan->pBlockCache->WriteBestInvalidWork(ArithToUint256(pIndexBestInvalid->nChainWork));
507 }
508 LogPrint(BCLog::INFO, "[%d] invalid block=%s date=%s\n",
509 pIndexNew->height, pIndexNew->GetBlockHash().ToString(),
510 DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pIndexNew->GetBlockTime()));
511
512 LogPrint(BCLog::INFO, "[%d] current best=%s date=%s\n",
513 chainActive.Height(), chainActive.Tip()->GetBlockHash().ToString(),
514 DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()));
515
516 CheckForkWarningConditions();
517}
518
519void static InvalidBlockFound(CBlockIndex *pIndex, CBlock &block, const CValidationState &state) {
520 int32_t nDoS = 0;

Callers 4

InvalidBlockFoundFunction · 0.85
InvalidateBlockFunction · 0.85
ConnectBlockOnFinChainFunction · 0.85
ActivateBestChainFunction · 0.85

Calls 7

DateTimeStrFormatFunction · 0.85
HeightMethod · 0.80
TipMethod · 0.80
ToStringMethod · 0.45
GetBlockHashMethod · 0.45
GetBlockTimeMethod · 0.45

Tested by

no test coverage detected