Skip to content

Commit e2b3fb3

Browse files
committed
Optimize vInOutPoints insertion a bit
1 parent eecffe5 commit e2b3fb3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,9 +1133,8 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
11331133
set<COutPoint> vInOutPoints;
11341134
for (const auto& txin : tx.vin)
11351135
{
1136-
if (vInOutPoints.count(txin.prevout))
1136+
if (!vInOutPoints.insert(txin.prevout).second)
11371137
return state.DoS(100, false, REJECT_INVALID, "bad-txns-inputs-duplicate");
1138-
vInOutPoints.insert(txin.prevout);
11391138
}
11401139
}
11411140

0 commit comments

Comments
 (0)