From 49e9e0cfd381e1ddc3780be244f7ab296470b823 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 7 Aug 2019 06:52:16 -1100 Subject: [PATCH] Fix O detection in I state --- src/pow.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index 64a8af75d..5d19b8391 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -139,7 +139,7 @@ arith_uint256 RT_CST_RST_target(int32_t height,uint32_t nTime,arith_uint256 bnTa arith_uint256 RT_CST_RST_inner(int32_t height,uint32_t nTime,arith_uint256 bnTarget,uint32_t *ts,arith_uint256 *ct,int32_t numerator,int32_t denominator,int32_t W,int32_t past,int32_t outeri) { arith_uint256 bnTargetW,bnTargetwidth,bnTmp,mintarget; int32_t factor,elapsed,width = outeri+W; - fprintf(stderr,"check inner outeri.%d, width.%d %d vs %d\n",outeri,width,(ts[0] - ts[width]),width*T); + fprintf(stderr,"check inner outeri.%d, width.%d %d vs %d, deficit %d\n",outeri,width,(ts[0] - ts[width]),width*T,(ts[0] - ts[width]) - width*T); if ( (elapsed= (ts[0] - ts[width])) < width*T ) { if ( (factor= (elapsed - width*T)/T) >= 1 ) @@ -152,6 +152,8 @@ arith_uint256 RT_CST_RST_inner(int32_t height,uint32_t nTime,arith_uint256 bnTar else bnTmp = bnTargetwidth; if ( bnTmp < bnTarget ) bnTarget = bnTmp; + if ( factor > 1 ) + bnTarget = (bnTarget / arith_uint256(3)) * arith_uint256(2); if ( bnTarget > mintarget ) bnTarget = mintarget; } @@ -371,16 +373,9 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead } else { - if ( height < 70 ) - { - for (i=0; inTime,bnTarget,ts,ct,1,2,3,past,i);