From 9c2f6f11bb3c45991e1b4a294aa0130b17404d76 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 5 Jul 2018 05:44:54 -1100 Subject: [PATCH] Work around inadvertent CPU mining --- src/komodo_bitcoind.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 5cd88d7de..0f49c3758 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1248,13 +1248,16 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ { CBlockIndex *previndex; char voutaddr[64],destaddr[64]; uint256 txid; uint32_t txtime,prevtime=0; int32_t vout,txn_count,eligible,isPoS = 0; uint64_t value; CTxDestination voutaddress; txn_count = pblock->vtx.size(); - if ( txn_count > 1 ) + if ( ASSETCHAINS_STAKED == 100 && height < 1000 ) + return(1); + if ( txn_count > 1 && pblock->vtx[txn_count-1].vout.size() == 1 ) { if ( prevtime == 0 ) { if ( (previndex= mapBlockIndex[pblock->hashPrevBlock]) != 0 ) prevtime = (uint32_t)previndex->nTime; } + // add strict check for 100% of vin -> vout txid = pblock->vtx[txn_count-1].vin[0].prevout.hash; vout = pblock->vtx[txn_count-1].vin[0].prevout.n; if ( prevtime != 0 ) @@ -1265,7 +1268,7 @@ int32_t komodo_is_PoSblock(int32_t slowflag,int32_t height,CBlock *pblock,arith_ fprintf(stderr,"komodo_is_PoSblock PoS failure ht.%d eligible.%u vs blocktime.%u, lag.%d -> check to see if it is PoW block\n",height,eligible,(uint32_t)pblock->nTime,(int32_t)(eligible - pblock->nTime)); } else isPoS = 1; } - else if ( slowflag == 0 ) // maybe previous block is not seen yet, do the best approx + if ( slowflag == 0 ) // maybe previous block is not seen yet, do the best approx { txtime = komodo_txtime(&value,txid,vout,destaddr); if ( ExtractDestination(pblock->vtx[txn_count-1].vout[0].scriptPubKey,voutaddress) )