Near-Bugfix: Reestablish consensus check removed in 8d7849b

in 8d7849b6db

This can potentially prevent an overflow that could at least in theory
allow the creation of money.
This commit is contained in:
Jorge Timón 2017-07-04 17:45:46 +02:00
parent 3e8c91629e
commit 4e955c58e1
No known key found for this signature in database
GPG key ID: 8866C18EA1C944A2

View file

@ -1638,6 +1638,10 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
return error("%s: Consensus::CheckTxInputs: %s, %s", __func__, tx.GetHash().ToString(), FormatStateMessage(state)); return error("%s: Consensus::CheckTxInputs: %s, %s", __func__, tx.GetHash().ToString(), FormatStateMessage(state));
} }
nFees += txfee; nFees += txfee;
if (!MoneyRange(nFees)) {
return state.DoS(100, error("%s: accumulated fee in the block out of range.", __func__),
REJECT_INVALID, "bad-txns-accumulated-fee-outofrange");
}
// Check that transaction is BIP68 final // Check that transaction is BIP68 final
// BIP68 lock checks (as opposed to nLockTime checks) must // BIP68 lock checks (as opposed to nLockTime checks) must