From af187c9c36c9f1cb05a39d60e4f9053cd8598ae4 Mon Sep 17 00:00:00 2001 From: myriadcoin Date: Wed, 24 Sep 2014 23:07:32 +0200 Subject: [PATCH] Chain work modify --- src/main.cpp | 4 ++-- src/main.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fc132fec..3ab63a31 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2453,14 +2453,14 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp) int nAlgo = block.GetAlgo(); int nAlgoCount = 1; CBlockIndex* piPrev = pindexPrev; - while (piPrev && (nAlgoCount < nBlockSequentialAlgoMaxCount)) + while (piPrev && (nAlgoCount <= nBlockSequentialAlgoMaxCount)) { if (piPrev->GetAlgo() != nAlgo) break; nAlgoCount++; piPrev = piPrev->pprev; } - if (nAlgoCount >= nBlockSequentialAlgoMaxCount) + if (nAlgoCount > nBlockSequentialAlgoMaxCount) { return state.DoS(100, error("AcceptBlock() : too many blocks from same algo"), REJECT_INVALID, "algo-toomany"); diff --git a/src/main.h b/src/main.h index 0833c519..087bc86c 100644 --- a/src/main.h +++ b/src/main.h @@ -690,7 +690,7 @@ enum BlockStatus { const int64_t nBlockAlgoWorkWeightStart = 142000; // block where algo work weighting starts const int64_t nBlockAlgoNormalisedWorkStart = 633800; // block where algo combined weight starts const int64_t nBlockSequentialAlgoRuleStart = 633800; // block where sequential algo rule starts -const int nBlockSequentialAlgoMaxCount = 8; // maximum sequential blocks of same algo +const int nBlockSequentialAlgoMaxCount = 6; // maximum sequential blocks of same algo /** The block chain is a tree shaped structure starting with the * genesis block at the root, with each block potentially having multiple