From cf7f440296051d591b1c52afcd3766177e832907 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 6 Apr 2018 18:29:45 +0300 Subject: [PATCH] Test --- src/komodo_gateway.h | 2 +- src/main.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index a799927f9..c8fc03980 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -711,7 +711,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above if ( height >= activation ) return(-1); } - else if ( block.nBits == KOMODO_MINDIFF_NBITS && total > 0 ) + else if ( block.nBits == KOMODO_MINDIFF_NBITS && total > 0 ) // to deal with fee stealing { fprintf(stderr,"notary mined ht.%d with extra %.8f\n",height,dstr(total)); if ( height > KOMODO_NOTARIES_HEIGHT1 ) diff --git a/src/main.cpp b/src/main.cpp index 2d699f9e5..f45ad7bad 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2585,7 +2585,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime1 - nTimeStart), 0.001 * (nTime1 - nTimeStart) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime1 - nTimeStart) / (nInputs-1), nTimeConnect * 0.000001); CAmount blockReward = nFees + GetBlockSubsidy(pindex->nHeight, chainparams.GetConsensus()) + sum; - if ( block.vtx[0].GetValueOut() > blockReward ) + if ( block.vtx[0].GetValueOut() > blockReward+1 ) { if ( pindex->nHeight >= KOMODO_NOTARIES_HEIGHT1 || block.vtx[0].vout[0].nValue > blockReward ) { @@ -2593,7 +2593,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin error("ConnectBlock(): coinbase pays too much (actual=%d vs limit=%d)", block.vtx[0].GetValueOut(), blockReward), REJECT_INVALID, "bad-cb-amount"); - } else fprintf(stderr,"allow nHeight.%d coinbase %.8f vs %.8f interest %.8f\n",(int32_t)pindex->nHeight,dstr(block.vtx[0].GetValueOut()),dstr(blockReward),dstr(sum)); + } else if ( NOTARY_PUBKEY33[0] != 0 ) + fprintf(stderr,"allow nHeight.%d coinbase %.8f vs %.8f interest %.8f\n",(int32_t)pindex->nHeight,dstr(block.vtx[0].GetValueOut()),dstr(blockReward),dstr(sum)); } if (!control.Wait()) return state.DoS(100, false);