From 1076f8fe3514bf833c8fac8862531ca30c90065e Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 7 Aug 2019 01:52:17 -1100 Subject: [PATCH] Make ct[] diffs correct --- src/pow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index 78053398a..e4a4e4e41 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -105,7 +105,7 @@ arith_uint256 RT_CST_RST(int32_t height,uint32_t nTime,arith_uint256 bnTarget,ui if ( ((ts[0]-ts[W]) * W * 100)/(W-1) < (T * numerator * 100)/denominator ) { //bnTarget = ((ct[0]-ct[1])/K) * max(K,(K*(nTime-ts[0])*(ts[0]-ts[W])*denominator/numerator)/T/T); - bnTarget = (ct[0] - ct[1]) / arith_uint256(K); + bnTarget = ct[0] / arith_uint256(K); altK = (K * (nTime-ts[0]) * (ts[0]-ts[W]) * denominator * W) / (numerator * (W-1) * (T * T)); fprintf(stderr,"ht.%d initial altK.%lld %d * %d * %d / %d\n",height,(long long)altK,(nTime-ts[0]),(ts[0]-ts[W]),denominator,numerator); if ( altK > K ) @@ -146,7 +146,10 @@ arith_uint256 RT_CST_RST(int32_t height,uint32_t nTime,arith_uint256 bnTarget,ui Rarely, last 3 STs can be 1/2 speed => target = prevTarget at T/2, & 1/2 at T.*/ //bnTarget = ((ct[0]-ct[W])/W/K) * (K*(nTime-ts[0])*(ts[0]-ts[W]))/W/T/T; - bnTarget = (ct[0]-ct[W]) / arith_uint256(W * K); + bnTarget = ct[0]; + for (i=1; i