diff options
| author | Satoshi Nakamoto <[email protected]> | 2010-08-15 23:09:29 +0000 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2010-08-15 23:09:29 +0000 |
| commit | 76793dc969f5ee9feadb6827845c1682b11914a6 (patch) | |
| tree | 43ec9d108255f289be5bfd778e0b98cd77b17dbd /main.cpp | |
| parent | misc changes (diff) | |
| download | discoin-76793dc969f5ee9feadb6827845c1682b11914a6.tar.xz discoin-76793dc969f5ee9feadb6827845c1682b11914a6.zip | |
fix for block 74638 overflow output transaction
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |