From e2b3fb349ed99f05ea518c7eb260db606350a2b5 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 9 Nov 2016 11:28:41 -0800 Subject: [PATCH] Optimize vInOutPoints insertion a bit --- src/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c8af01983..6e19123a4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1133,9 +1133,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe set vInOutPoints; 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"); - vInOutPoints.insert(txin.prevout); } }