From 47fcb0f0672836dec31b82ce0fe9a1944dd98db6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 5 Aug 2019 22:20:15 -1100 Subject: [PATCH] Tip-off based factor --- src/pow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index 64d082b2e..0b708cb3d 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -183,7 +183,7 @@ arith_uint256 zawy_exponential(arith_uint256 bnTarget,int32_t mult) return(bnTarget); } -// 10:49 launch for ZAWY17 +// 11:15 launch for ZAWY17 unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params) { @@ -304,9 +304,9 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead bnTarget = bnTmp; if ( bnTarget < origtarget ) { - if ( bnTarget < origtarget/arith_uint256(3) ) + if ( tipdiff < T ) zawyflag = 1; - else if ( bnTarget < origtarget / arith_uint256(2) ) + else if ( tipdiff > 2*T && tipdiff < 3*T ) zawyflag = 2; else zawyflag = 3; { @@ -314,7 +314,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead for (z=31; z>=0; z--) fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[z]); } - fprintf(stderr," ht.%d -> zawy.%d\n",height,zawyflag); + fprintf(stderr," ht.%d -> zawy.%d tipdiff.%d\n",height,zawyflag,tipdiff); } else bnTarget = origtarget; } nbits = bnTarget.GetCompact();