Fix PoW recalc
This commit is contained in:
@@ -222,11 +222,10 @@ uint64_t RewardsPlanFunds(uint64_t refsbits,struct CCcontract_info *cp,CPubKey p
|
|||||||
if ( refsbits == sbits && (nValue= IsRewardsvout(cp,tx,vout)) > 0 )
|
if ( refsbits == sbits && (nValue= IsRewardsvout(cp,tx,vout)) > 0 )
|
||||||
{
|
{
|
||||||
totalinputs += nValue;
|
totalinputs += nValue;
|
||||||
fprintf(stderr,"got utxo\n");
|
|
||||||
}
|
}
|
||||||
else fprintf(stderr,"refsbits.%llx sbits.%llx nValue %.8f\n",(long long)refsbits,(long long)sbits,(double)nValue/COIN);
|
else fprintf(stderr,"refsbits.%llx sbits.%llx nValue %.8f\n",(long long)refsbits,(long long)sbits,(double)nValue/COIN);
|
||||||
} else fprintf(stderr,"else case\n");
|
} else fprintf(stderr,"else case\n");
|
||||||
} else fprintf(stderr,"funcid.%d skipped\n",funcid);
|
} else fprintf(stderr,"funcid.%d %c skipped %.8f\n",funcid,funcid,(double)tx.vout[vout].nValue/COIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(totalinputs);
|
return(totalinputs);
|
||||||
|
|||||||
@@ -1385,7 +1385,7 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
|||||||
bnTarget = ((ave * arith_uint256(goalperc)) + (easydiff * arith_uint256(percPoS))) / arith_uint256(percPoS + goalperc);
|
bnTarget = ((ave * arith_uint256(goalperc)) + (easydiff * arith_uint256(percPoS))) / arith_uint256(percPoS + goalperc);
|
||||||
//bnTarget = (bnTarget * arith_uint256(percPoS * percPoS * percPoS)) / arith_uint256(goalperc * goalperc);
|
//bnTarget = (bnTarget * arith_uint256(percPoS * percPoS * percPoS)) / arith_uint256(goalperc * goalperc);
|
||||||
bnTarget = (bnTarget / arith_uint256(goalperc * goalperc)) * arith_uint256(percPoS * percPoS * percPoS);
|
bnTarget = (bnTarget / arith_uint256(goalperc * goalperc)) * arith_uint256(percPoS * percPoS * percPoS);
|
||||||
} else bnTarget = (bnTarget / arith_uint256(goalperc * goalperc)) * arith_uint256(percPoS * percPoS * percPoS);
|
} else bnTarget = (ave / arith_uint256(goalperc * goalperc)) * arith_uint256(percPoS * percPoS * percPoS);
|
||||||
if ( bnTarget > easydiff )
|
if ( bnTarget > easydiff )
|
||||||
bnTarget = easydiff;
|
bnTarget = easydiff;
|
||||||
else if ( bnTarget < ave ) // overflow
|
else if ( bnTarget < ave ) // overflow
|
||||||
|
|||||||
Reference in New Issue
Block a user