aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2010-08-15 20:28:01 +0000
committerGavin Andresen <gavinandresen@gmail.com>2010-08-15 20:28:01 +0000
commit2d12315c94f12d62b2f2aa39e63511a2042fe55d (patch)
tree0502400547c2ee8a0a16c9a69c57a1fef68bbaca
parent7f71fd13ae5c61bf844591d93e74803e85601931 (diff)
downloadbitcoin-2d12315c94f12d62b2f2aa39e63511a2042fe55d.tar.xz
Quick fix: bad block 74,652
-rw-r--r--main.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.h b/main.h
index 871224b709..80687c8612 100644
--- a/main.h
+++ b/main.h
@@ -473,8 +473,12 @@ public:
// Check for negative values
foreach(const CTxOut& txout, vout)
+ {
if (txout.nValue < 0)
return error("CTransaction::CheckTransaction() : txout.nValue negative");
+ if (txout.nValue > 21000000*COIN)
+ return error("CTransaction::CheckTransaction() : txout.nValue over-max");
+ }
if (IsCoinBase())
{
@@ -520,6 +524,8 @@ public:
int64 nValueOut = 0;
foreach(const CTxOut& txout, vout)
{
+ if (txout.nValue > 21000000*COIN)
+ continue; // ignore over-max-value...
if (txout.nValue < 0)
throw runtime_error("CTransaction::GetValueOut() : negative value");
nValueOut += txout.nValue;