aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 4bcb87f614..f129fb6506 100644
--- a/src/main.cpp
+++ b/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)