Chain work modify

This commit is contained in:
myriadcoin
2014-09-24 23:07:32 +02:00
parent cc63dc117e
commit af187c9c36
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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");
+1 -1
View File
@@ -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