Skip to content

Commit 4e955c5

Browse files
committed
Near-Bugfix: Reestablish consensus check removed in 8d7849b
in 8d7849b This can potentially prevent an overflow that could at least in theory allow the creation of money.
1 parent 3e8c916 commit 4e955c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/validation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,10 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
16381638
return error("%s: Consensus::CheckTxInputs: %s, %s", __func__, tx.GetHash().ToString(), FormatStateMessage(state));
16391639
}
16401640
nFees += txfee;
1641+
if (!MoneyRange(nFees)) {
1642+
return state.DoS(100, error("%s: accumulated fee in the block out of range.", __func__),
1643+
REJECT_INVALID, "bad-txns-accumulated-fee-outofrange");
1644+
}
16411645

16421646
// Check that transaction is BIP68 final
16431647
// BIP68 lock checks (as opposed to nLockTime checks) must

0 commit comments

Comments
 (0)