Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 2,909 Lines • ▼ Show 20 Lines | if (!AreOnTheSameFork(pindex, chainActive.Tip())) { | ||||
CBlockIndex *pindexToInvalidate = | CBlockIndex *pindexToInvalidate = | ||||
chainActive.Tip()->GetAncestor(pindexFork->nHeight + 1); | chainActive.Tip()->GetAncestor(pindexFork->nHeight + 1); | ||||
return InvalidateBlock(config, state, pindexToInvalidate); | return InvalidateBlock(config, state, pindexToInvalidate); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
const CBlockIndex *GetFinalizedBlock() { | |||||
AssertLockHeld(cs_main); | |||||
return pindexFinalized; | |||||
} | |||||
bool InvalidateBlock(const Config &config, CValidationState &state, | bool InvalidateBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex) { | CBlockIndex *pindex) { | ||||
return UnwindBlock(config, state, pindex, true); | return UnwindBlock(config, state, pindex, true); | ||||
} | } | ||||
bool ParkBlock(const Config &config, CValidationState &state, | bool ParkBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex) { | CBlockIndex *pindex) { | ||||
return UnwindBlock(config, state, pindex, false); | return UnwindBlock(config, state, pindex, false); | ||||
▲ Show 20 Lines • Show All 2,510 Lines • Show Last 20 Lines |