aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorSatoshi Nakamoto <[email protected]>2010-08-15 23:09:29 +0000
committerGavin Andresen <[email protected]>2010-08-15 23:09:29 +0000
commit76793dc969f5ee9feadb6827845c1682b11914a6 (patch)
tree43ec9d108255f289be5bfd778e0b98cd77b17dbd /main.cpp
parentmisc changes (diff)
downloaddiscoin-76793dc969f5ee9feadb6827845c1682b11914a6.tar.xz
discoin-76793dc969f5ee9feadb6827845c1682b11914a6.zip
fix for block 74638 overflow output transaction
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index cc263db28..b193536d3 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1006,6 +1006,14 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
mapTestPool[prevout.hash] = txindex;
nValueIn += txPrev.vout[prevout.n].nValue;
+
+ // Check for negative or overflow input values
+ if (txPrev.vout[prevout.n].nValue < 0)
+ return error("ConnectInputs() : txin.nValue negative");
+ if (txPrev.vout[prevout.n].nValue > MAX_MONEY)
+ return error("ConnectInputs() : txin.nValue too high");
+ if (nValueIn > MAX_MONEY)
+ return error("ConnectInputs() : txin total too high");
}
// Tally transaction fees