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

Function InvalidateBlockIndex

src/main.cpp:544–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542}
543
544bool InvalidateBlockIndex(CBlockIndex *pIndex) {
545 pIndex->nStatus |= BLOCK_FAILED_VALID;
546 if(!UpdateBlockIndexDB(pIndex)) {
547 return ERRORMSG("update block=%s index failed", pIndex->GetIdString());
548 }
549
550 setBlockIndexValid.erase(pIndex);
551 LogPrint(BCLog::INFO, "Invalidate block=%s BLOCK_FAILED_VALID\n", pIndex->GetIdString());
552 return true;
553}
554
555bool InvalidateBlock(CValidationState &state, CBlockIndex *pIndex) {
556 AssertLockHeld(cs_main);

Callers 1

InvalidateBlockFunction · 0.85

Calls 3

UpdateBlockIndexDBFunction · 0.85
GetIdStringMethod · 0.80
eraseMethod · 0.45

Tested by

no test coverage detected