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

Function ReconsiderBlockIndex

src/main.cpp:579–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577
578
579bool ReconsiderBlockIndex(CBlockIndex *pIndex) {
580 pIndex->nStatus &= ~BLOCK_FAILED_MASK;
581
582 if(!UpdateBlockIndexDB(pIndex)) {
583 return ERRORMSG("update block=%s index failed", pIndex->GetIdString());
584 }
585 setBlockIndexValid.insert(pIndex);
586 if (pIndex == pIndexBestInvalid) {
587 // Reset invalid block marker if it was pointing to one of those.
588 pIndexBestInvalid = nullptr;
589 }
590 return true;
591}
592
593bool ReconsiderBlock(CValidationState &state, CBlockIndex *pIndex, bool children) {
594 AssertLockHeld(cs_main);

Callers 1

ReconsiderBlockFunction · 0.85

Calls 3

UpdateBlockIndexDBFunction · 0.85
GetIdStringMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected