Merge pull request #5 from CryptoManiac/master
author0xDEADFACE <masmfan@gmail.com>
Mon, 17 Feb 2014 18:18:58 +0000 (10:18 -0800)
committer0xDEADFACE <masmfan@gmail.com>
Mon, 17 Feb 2014 18:18:58 +0000 (10:18 -0800)
CheckTransaction() strengthening

src/main.cpp

index c4f3d17..4f10bfe 100644 (file)
@@ -486,6 +486,8 @@ bool CTransaction::CheckTransaction() const
         if (!fTestNet && !IsCoinBase() && !txout.IsEmpty() && nTime < OUTPUT_SWITCH_TIME && txout.nValue < MIN_TXOUT_AMOUNT)
             return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue below minimum"));
 
+        if (txout.nValue < 0)
+            return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue is negative"));
         if (txout.nValue > MAX_MONEY)
             return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue too high"));
         nValueOut += txout.nValue;