diff options
author | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-08-15 21:35:24 +0000 |
---|---|---|
committer | s_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b> | 2010-08-15 21:35:24 +0000 |
commit | d4c6b90ca3f9b47adb1b2724a0c3514f80635c84 (patch) | |
tree | 130a0b0e35b71736714e6dac7d26a328627a82ca /main.cpp | |
parent | 4bd188c4383d6e614e18f79dc337fbabe8464c82 (diff) |
fix for block 74638 overflow output transaction
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@132 1a98c847-1fd6-4fd8-948a-caf3550aa51b
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
|