From a030053610246158540e5c8476fd8ba8adf5811d Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Apr 2018 22:55:21 +0300 Subject: [PATCH] Test --- src/miner.cpp | 2 +- src/wallet/rpcwallet.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 69a7d240c..4817da0ba 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -415,7 +415,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) pblocktemplate->vTxSigOps.push_back(numsigs); nFees += txfees; pblock->nTime = blocktime; - } + } else fprintf(stderr,"no utxos eligible for staking\n"); } // Create coinbase tx diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 54a9350b6..71c2025ed 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4487,9 +4487,9 @@ int32_t komodo_staked(uint32_t nBits,uint32_t *blocktimep,uint32_t *txtimep,uint } entry.push_back(Pair("amount",ValueFromAmount(nValue)));*/ BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock()); - CBlockIndex *tipindex,*pindex = it->second; + CBlockIndex *tipindex; uint64_t interest; uint32_t locktime; int32_t txheight; - if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 ) + if ( (tipindex= chainActive.Tip()) != 0 ) { eligible = komodo_stake(bnTarget,(uint32_t)tipindex->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)tipindex->nTime); if ( eligible > 0 ) @@ -4504,7 +4504,7 @@ int32_t komodo_staked(uint32_t nBits,uint32_t *blocktimep,uint32_t *txtimep,uint *txtimep = (uint32_t)out.tx->nLockTime; } } - fprintf(stderr,"(%s) %s/v%d nValue %.8f locktime.%u txheight.%d pindexht.%d\n",CBitcoinAddress(address).ToString().c_str(),out.tx->GetHash().GetHex().c_str(),out.i,(double)nValue/COIN,locktime,txheight,pindex->nHeight); + fprintf(stderr,"(%s) %s/v%d nValue %.8f locktime.%u txheight.%d\n",CBitcoinAddress(address).ToString().c_str(),out.tx->GetHash().GetHex().c_str(),out.i,(double)nValue/COIN,locktime,txheight); } } if ( earliest != 0 ) -- 2.42.0