Browse Source

Optimize vInOutPoints insertion a bit

0.14
Matt Corallo 8 years ago
parent
commit
e2b3fb349e
  1. 3
      src/main.cpp

3
src/main.cpp

@ -1133,9 +1133,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
set<COutPoint> vInOutPoints; set<COutPoint> vInOutPoints;
for (const auto& txin : tx.vin) for (const auto& txin : tx.vin)
{ {
if (vInOutPoints.count(txin.prevout)) if (!vInOutPoints.insert(txin.prevout).second)
return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-duplicate"); return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-duplicate");
vInOutPoints.insert(txin.prevout);
} }
} }

Loading…
Cancel
Save