Merged #1176: Added log message to print block height when IsBlockValueValid returns false
This commit is contained in:
parent
6d9e414c6a
commit
d88249b787
@ -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()));
|
||||
|
Loading…
Reference in New Issue
Block a user