This commit is contained in:
jl777
2019-08-03 02:30:24 -11:00
parent b4d67e7aad
commit f3e341722b

View File

@@ -165,6 +165,14 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
} else fprintf(stderr,"cmp.%d mult.%d for ht.%d\n",mult>1,(int32_t)mult,(int32_t)pindexLast->GetHeight()); } else fprintf(stderr,"cmp.%d mult.%d for ht.%d\n",mult>1,(int32_t)mult,(int32_t)pindexLast->GetHeight());
} }
else if ( block12diff != 0 && block7diff != 0 && block4diff != 0 ) else if ( block12diff != 0 && block7diff != 0 && block4diff != 0 )
{
if ( block4diff > 4 && block4diff < ASSETCHAINS_BLOCKTIME ) // for 10x and higher hashrate increases
{
block4diff += (2 * ASSETCHAINS_BLOCKTIME) / 3;
bnTarget = bnTarget * arith_uint256(block4diff) / arith_uint256(ASSETCHAINS_BLOCKTIME * 2);
fprintf(stderr,"ht.%d 4 blocks happened in %d adjust by %.4f\n",(int32_t)pindexLast->GetHeight(),block4diff-((2 * ASSETCHAINS_BLOCKTIME) / 3),(double)block4diff/(ASSETCHAINS_BLOCKTIME*2));
}
else
{ {
bnSum4 = zawy_targetMA(easy,bnSum4,block4diff * 5); bnSum4 = zawy_targetMA(easy,bnSum4,block4diff * 5);
bnSum7 = zawy_targetMA(easy,bnSum7,block7diff * 3); bnSum7 = zawy_targetMA(easy,bnSum7,block7diff * 3);
@@ -195,13 +203,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
bnTarget = bnTmp; bnTarget = bnTmp;
} //else fprintf(stderr,"nothing bigger\n"); } //else fprintf(stderr,"nothing bigger\n");
} }
/*if ( block4diff > 4 && block4diff < ASSETCHAINS_BLOCKTIME ) // for 10x and higher hashrate increases
{
block4diff += (2 * ASSETCHAINS_BLOCKTIME) / 3;
bnTarget = bnTarget * arith_uint256(block4diff) / arith_uint256(ASSETCHAINS_BLOCKTIME * 2);
fprintf(stderr,"ht.%d 4 blocks happened in %d adjust by %.4f\n",(int32_t)pindexLast->GetHeight(),block4diff-((2 * ASSETCHAINS_BLOCKTIME) / 3),(double)block4diff/(ASSETCHAINS_BLOCKTIME*2));
} }
*/
} // else fprintf(stderr,"null diff %d %d %d\n",block4diff,block7diff,block12diff); } // else fprintf(stderr,"null diff %d %d %d\n",block4diff,block7diff,block12diff);
nbits = bnTarget.GetCompact(); nbits = bnTarget.GetCompact();
} }