aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorJorge Timón <jtimon@jtimon.cc>2017-07-04 17:45:46 +0200
committerJorge Timón <jtimon@jtimon.cc>2017-09-20 23:26:02 +0200
commit4e955c58e13cfe089208f6b23b195d395ad99baa (patch)
tree4cb82c297e52ca1b2b91ff92a338651a72c62291 /src/validation.cpp
parent3e8c91629e646f1ace700fe394f5bbef88b9cd31 (diff)
Near-Bugfix: Reestablish consensus check removed in 8d7849b
in 8d7849b6db5f54dc32fe4f8c6c7283068473cd21 This can potentially prevent an overflow that could at least in theory allow the creation of money.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 8899bd2cdc..2e2a89bcf4 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -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));
}
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
// BIP68 lock checks (as opposed to nLockTime checks) must