diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 5f96bf2b8..5b605a4aa 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1154,6 +1154,8 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he for (i=n=0; i<100; i++) { ht = height - 100 + i; + if ( ht <= 1 ) + continue; if ( (pindex= komodo_chainactive(ht)) != 0 ) { bnTarget.SetCompact(pindex->nBits,&fNegative,&fOverflow); @@ -1341,7 +1343,8 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height) { if ( slowflag != 0 ) bnTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED); - else bnTarget = (bnTarget / arith_uint256(KOMODO_POWMINMULT)); // lower bound + else if ( height > 100 ) + bnTarget = (bnTarget / arith_uint256(KOMODO_POWMINMULT)); // lower bound if ( bhash > bnTarget ) { for (i=31; i>=16; i--) diff --git a/src/main.cpp b/src/main.cpp index 34d939431..12433f1e8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4273,7 +4273,7 @@ bool ProcessNewBlock(bool from_miner,int32_t height,CValidationState &state, CNo if ( checked != 0 && komodo_checkPOW(from_miner && ASSETCHAINS_STAKED == 0,pblock,height) < 0 ) { checked = 0; - fprintf(stderr,"passed checkblock but failed checkPOW.%d\n",from_miner && ASSETCHAINS_STAKED == 0); + //fprintf(stderr,"passed checkblock but failed checkPOW.%d\n",from_miner && ASSETCHAINS_STAKED == 0); } if (!checked && futureblock == 0) {