| 497 | } |
| 498 | |
| 499 | void 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 | |
| 519 | void static InvalidBlockFound(CBlockIndex *pIndex, CBlock &block, const CValidationState &state) { |
| 520 | int32_t nDoS = 0; |
no test coverage detected