@@ -1293,7 +1293,6 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
|||||||
fprintf(stderr,"1");
|
fprintf(stderr,"1");
|
||||||
sum += UintToArith256(pindex->GetBlockHash());
|
sum += UintToArith256(pindex->GetBlockHash());
|
||||||
m++;
|
m++;
|
||||||
n++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if ( (pindex= komodo_chainactive(ht)) != 0 )
|
/*if ( (pindex= komodo_chainactive(ht)) != 0 )
|
||||||
@@ -1349,10 +1348,11 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
|||||||
}
|
}
|
||||||
else if ( percPoS > goalperc ) // decrease PoW diff -> raise bnTarget
|
else if ( percPoS > goalperc ) // decrease PoW diff -> raise bnTarget
|
||||||
{
|
{
|
||||||
//bnTarget = ((ave * arith_uint256(goalperc)) + (easydiff * arith_uint256(percPoS))) / arith_uint256(percPoS + goalperc);
|
|
||||||
bnTarget = (ave * arith_uint256(percPoS * percPoS * percPoS)) / arith_uint256(goalperc * goalperc);
|
bnTarget = (ave * arith_uint256(percPoS * percPoS * percPoS)) / arith_uint256(goalperc * goalperc);
|
||||||
if ( bnTarget > easydiff || bnTarget < ave )
|
if ( bnTarget > easydiff )
|
||||||
bnTarget = easydiff;
|
bnTarget = easydiff;
|
||||||
|
else if ( bnTarget < ave ) // overflow
|
||||||
|
bnTarget = ((ave * arith_uint256(goalperc)) + (easydiff * arith_uint256(percPoS))) / arith_uint256(percPoS + goalperc);
|
||||||
if ( 1 )
|
if ( 1 )
|
||||||
{
|
{
|
||||||
for (i=31; i>=24; i--)
|
for (i=31; i>=24; i--)
|
||||||
|
|||||||
Reference in New Issue
Block a user