Skip to content

Commit

Permalink
Skip higher coinbase spent block post Eunos
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Fieroni <[email protected]>
  • Loading branch information
bvbfan committed May 19, 2021
1 parent 7187082 commit ede7ead
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3512,6 +3512,7 @@ bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainPar
if (state.IsInvalid()) {
// The block violates a consensus rule.
auto reason = state.GetReason();

if (reason == ValidationInvalidReason::BLOCK_INVALID_HEADER) {
// at this stage only high hash error can be in header
// so just skip that block
Expand All @@ -3526,7 +3527,7 @@ bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainPar
// so we should not shoutdown entire network, let's skip it
continue;
} else if (reason == ValidationInvalidReason::CONSENSUS) {
if (pindexConnect->nHeight == chainparams.GetConsensus().EunosHeight) {
if (pindexConnect->nHeight >= chainparams.GetConsensus().EunosHeight) {
auto strReason = state.GetRejectReason();
// we have situation when old masternode will generate a block
// that has coinbase higher than post Eunos fork
Expand Down Expand Up @@ -6147,4 +6148,4 @@ class CMainCleanup
g_blockman.m_block_index.clear();
}
};
static CMainCleanup instance_of_cmaincleanup;
static CMainCleanup instance_of_cmaincleanup;

0 comments on commit ede7ead

Please sign in to comment.