Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check for duplicate txins in CheckTransaction.

  • Loading branch information...
commit 33208fb5575d76a19163e830617eaaf32dbacda8 1 parent e1f1312
@TheBlueMatt authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/main.cpp
View
9 src/main.cpp
@@ -314,6 +314,15 @@ bool CTransaction::CheckTransaction() const
return error("CTransaction::CheckTransaction() : txout total out of range");
}
+ // Check for duplicate inputs
+ set<COutPoint> vInOutPoints;
+ BOOST_FOREACH(const CTxIn& txin, vin)
+ {
+ if (vInOutPoints.count(txin.prevout))
+ return false;
+ vInOutPoints.insert(txin.prevout);
+ }
+
if (IsCoinBase())
{
if (vin[0].scriptSig.size() < 2 || vin[0].scriptSig.size() > 100)
Please sign in to comment.
Something went wrong with that request. Please try again.