From d88249b787d21d333ea6c5970148e05265a6066f Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Thu, 1 Dec 2016 08:58:17 -0500 Subject: [PATCH] Merged #1176: Added log message to print block height when IsBlockValueValid returns false --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index f4e61aff6..73f146367 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2773,11 +2773,13 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // DASH : MODIFYED TO CHECK MASTERNODE PAYMENTS AND SUPERBLOCKS CAmount blockReward = nFees + GetBlockSubsidy(pindex->pprev->nBits, pindex->pprev->nHeight, chainparams.GetConsensus()); - if (!IsBlockValueValid(block, pindex->nHeight, blockReward)) + if (!IsBlockValueValid(block, pindex->nHeight, blockReward)) { + LogPrintf("ConnectBlock() -- IsBlockValueValid returned false, nHeight = %d\n", pindex->nHeight); // TODO: handle error here more accurate - this could actually fail for different reasons return state.DoS(100, error("ConnectBlock(): coinbase pays too much (actual=%d vs limit=%d)", block.vtx[0].GetValueOut(), blockReward), REJECT_INVALID, "bad-cb-amount"); + } if (!IsBlockPayeeValid(block.vtx[0], pindex->nHeight, blockReward)) { mapRejectedBlocks.insert(make_pair(block.GetHash(), GetTime()));