ban clients with forked chains

This commit is contained in:
Michel van Kessel
2021-02-23 16:28:28 +01:00
parent 08a4ccb614
commit 574f2ffd73

View File

@@ -3653,7 +3653,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
int nHeight = pindexPrev->nHeight+1;
if (chainActive.Height() - nHeight >= consensusParams.nMaxReorganizationDepth)
return state.DoS(1, error("%s: forked chain older than max reorganization depth (height %d)", __func__, nHeight));
return state.DoS(100, error("%s: forked chain older than max reorganization depth (height %d)", __func__, nHeight));
// Preliminary check difficulty in pos-only stage
if (chainActive.Height() > consensusParams.nLastPOWBlock && nHeight > consensusParams.nLastPOWBlock && block.nBits != GetNextTargetRequired(pindexPrev, &block, consensusParams, true))