Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 3,267 Lines • ▼ Show 20 Lines | void CChainState::UnparkBlockImpl(CBlockIndex *pindex, bool fClearChildren) { | ||||
if (pindexBestParked && | if (pindexBestParked && | ||||
(pindexBestParked->GetAncestor(pindex->nHeight) == pindex || | (pindexBestParked->GetAncestor(pindex->nHeight) == pindex || | ||||
pindex->GetAncestor(pindexBestParked->nHeight) == pindexBestParked)) { | pindex->GetAncestor(pindexBestParked->nHeight) == pindexBestParked)) { | ||||
// Reset the parked block marker if it is about to be cleared. | // Reset the parked block marker if it is about to be cleared. | ||||
pindexBestParked = nullptr; | pindexBestParked = nullptr; | ||||
} | } | ||||
UpdateFlags(pindex, | UpdateFlags( | ||||
pindex, | |||||
[](const BlockStatus status) { | [](const BlockStatus status) { | ||||
return status.withClearedParkedFlags(); | return status.withClearedParkedFlags(); | ||||
}, | }, | ||||
[fClearChildren](const BlockStatus status) { | [fClearChildren](const BlockStatus status) { | ||||
return fClearChildren ? status.withClearedParkedFlags() | return fClearChildren ? status.withClearedParkedFlags() | ||||
: status.withParkedParent(false); | : status.withParkedParent(false); | ||||
}); | }); | ||||
} | } | ||||
void UnparkBlockAndChildren(CBlockIndex *pindex) { | void UnparkBlockAndChildren(CBlockIndex *pindex) { | ||||
return g_chainstate.UnparkBlockImpl(pindex, true); | return g_chainstate.UnparkBlockImpl(pindex, true); | ||||
} | } | ||||
void UnparkBlock(CBlockIndex *pindex) { | void UnparkBlock(CBlockIndex *pindex) { | ||||
return g_chainstate.UnparkBlockImpl(pindex, false); | return g_chainstate.UnparkBlockImpl(pindex, false); | ||||
▲ Show 20 Lines • Show All 2,495 Lines • Show Last 20 Lines |