|
|
@ -102,11 +102,11 @@ arith_uint256 RT_CST_RST(int32_t height,uint32_t nTime,arith_uint256 bnTarget,ui |
|
|
|
int64_t altK; int32_t i,j,ii=0; // K is a scaling factor for integer divisions
|
|
|
|
if ( height < 64 ) |
|
|
|
return(bnTarget); |
|
|
|
if ( ts[0]-ts[W] < T*numerator/denominator ) |
|
|
|
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); |
|
|
|
altK = (K * (nTime-ts[0]) * (ts[0]-ts[W]) * denominator / numerator) / (T * T); |
|
|
|
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 ) |
|
|
|
altK = K; |
|
|
@ -292,7 +292,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead |
|
|
|
{ |
|
|
|
origtarget = bnTarget; |
|
|
|
// bnTarget = RT_CST_RST (height,nTime,bnTarget, ts, cw, numerator, denominator, W, T, past);
|
|
|
|
bnTarget = RT_CST_RST(height,pblock->nTime,bnTarget,ts,ct,1,2,3,50); |
|
|
|
bnTarget = RT_CST_RST(height,pblock->nTime,bnTarget,ts,ct,1,2,3,20); |
|
|
|
if ( 0 ) |
|
|
|
{ |
|
|
|
bnTarget6 = RT_CST_RST(height,pblock->nTime,bnTarget,ts,ct,7,3,6,50); |
|
|
|