mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 651e343888 into merged_master (Bitcoin PR #16974)
This commit is contained in:
commit
fdf8be76de
1 changed files with 6 additions and 0 deletions
|
|
@ -1467,10 +1467,14 @@ static void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip) E
|
|||
CheckForkWarningConditions();
|
||||
}
|
||||
|
||||
// Called both upon regular invalid block discovery *and* InvalidateBlock
|
||||
void static InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
{
|
||||
if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork)
|
||||
pindexBestInvalid = pindexNew;
|
||||
if (pindexBestHeader != nullptr && pindexBestHeader->GetAncestor(pindexNew->nHeight) == pindexNew) {
|
||||
pindexBestHeader = ::ChainActive().Tip();
|
||||
}
|
||||
|
||||
LogPrintf("%s: invalid block=%s height=%d date=%s\n", __func__,
|
||||
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight,
|
||||
|
|
@ -1483,6 +1487,8 @@ void static InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(c
|
|||
CheckForkWarningConditions();
|
||||
}
|
||||
|
||||
// Same as InvalidChainFound, above, except not called directly from InvalidateBlock,
|
||||
// which does its own setBlockIndexCandidates manageent.
|
||||
void CChainState::InvalidBlockFound(CBlockIndex *pindex, const BlockValidationState &state) {
|
||||
if (state.GetResult() != BlockValidationResult::BLOCK_MUTATED) {
|
||||
pindex->nStatus |= BLOCK_FAILED_VALID;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue