diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 96c76245f..eee9a5067 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1135,12 +1135,12 @@ uint32_t komodo_segid32(char *coinaddr) return(addrhash.uints[0]); } -int8_t komodo_segid(int32_t height) +int8_t komodo_segid(int32_t nocache,int32_t height) { CTxDestination voutaddress; CBlock block; CBlockIndex *pindex; uint64_t value; uint32_t txtime; char voutaddr[64],destaddr[64]; int32_t txn_count,vout; uint256 txid; int8_t segid = -1; if ( height > 0 && (pindex= komodo_chainactive(height)) != 0 ) { - if ( pindex->segid >= -1 ) + if ( nocache == 0 && pindex->segid >= -1 ) return(pindex->segid); if ( komodo_blockload(block,pindex) == 0 ) { @@ -1175,7 +1175,7 @@ int32_t komodo_segids(uint8_t *hashbuf,int32_t height,int32_t n) memset(hashbuf,0xff,n); for (i=0; i prevtime+480 ) coinage *= ((blocktime+iter+segid*2) - (prevtime+400)); - //if ( nHeight >= 2500 && blocktime+iter+segid*2 > prevtime+180 ) - // coinage *= ((blocktime+iter+segid*2) - (prevtime+60)); coinage256 = arith_uint256(coinage+1); hashval = ratio * (UintToArith256(hash) / coinage256); - //if ( nHeight >= 900 && nHeight < 916 ) - // hashval = (hashval / coinage256); if ( hashval <= bnTarget ) { winner = 1; @@ -1310,7 +1299,7 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he continue; if ( (pindex= komodo_chainactive(ht)) != 0 ) { - if ( komodo_segid(ht) >= 0 ) + if ( komodo_segid(0,ht) >= 0 ) { n++; percPoS++; @@ -1455,7 +1444,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ if ( pindex != 0 && height > 100 ) { if ( pindex->segid == -2 ) - pindex->segid = komodo_segid(height); + pindex->segid = komodo_segid(1,height); } else fprintf(stderr,"unexpected null pindex for slowflag set ht.%d\n",height); } }