|
|
@ -1418,10 +1418,13 @@ uint32_t komodo_stakehash(uint256 *hashp,char *address,uint8_t *hashbuf,uint256 |
|
|
|
|
|
|
|
arith_uint256 komodo_adaptivepow_target(int32_t height,arith_uint256 bnTarget,uint32_t nTime) |
|
|
|
{ |
|
|
|
arith_uint256 origtarget,easy; int32_t diff; int64_t mult; bool fNegative,fOverflow; CBlockIndex *tipindex; |
|
|
|
arith_uint256 origtarget,easy; int32_t diff,tipdiff; int64_t mult; bool fNegative,fOverflow; CBlockIndex *tipindex; |
|
|
|
if ( height > 10 && (tipindex= komodo_chainactive(height - 1)) != 0 ) |
|
|
|
{ |
|
|
|
diff = (nTime - tipindex->GetMedianTimePast()); |
|
|
|
tipdiff = (nTime - tipindex->nTime); |
|
|
|
if ( tipdiff > 13*ASSETCHAINS_BLOCKTIME ) |
|
|
|
diff = 13*ASSETCHAINS_BLOCKTIME; |
|
|
|
if ( diff > 20 * ASSETCHAINS_BLOCKTIME ) |
|
|
|
{ |
|
|
|
mult = diff - 19 * ASSETCHAINS_BLOCKTIME; |
|
|
|