From 04673f764e3961920f2b003881d09d461b9f8840 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 7 Aug 2019 19:57:10 -1100 Subject: [PATCH] Simplify, try to reduce variance --- src/pow.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index cd5ae8636..458b3789c 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -194,7 +194,7 @@ arith_uint256 RT_CST_RST_target(int32_t height,uint32_t nTime,arith_uint256 bnTa bnTarget = ct[0]; for (i=1; i 2 ) - bnTarget = (bnTarget / arith_uint256(3)) * arith_uint256(2); - else if ( factor == 2 ) - bnTarget = (bnTarget / arith_uint256(4)) * arith_uint256(3); - if ( 1 && bnTarget > mintarget ) + bnTarget = RT_CST_RST_target(height,nTime,bnTarget,ts,ct,W); + if ( bnTarget > mintarget ) bnTarget = mintarget; - fprintf(stderr,"inner outeri.%d, width.%d %d vs %d, deficit %d factor.%d\n",outeri,width,(ts[0] - ts[width]),expected,expected - (ts[0] - ts[width]),factor); + { + int32_t z; + for (z=31; z>=0; z--) + fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[z]); + } + fprintf(stderr," inner outeri.%d, width.%d %d vs %d, deficit %d factor.%d\n",outeri,width,(ts[0] - ts[width]),expected,expected - (ts[0] - ts[width]),factor); } return(bnTarget); }