@@ -534,7 +534,7 @@ int GetUTXOConfirmations(const COutPoint& outpoint)
534
534
}
535
535
536
536
537
- bool CheckTransaction (const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs )
537
+ bool CheckTransaction (const CTransaction& tx, CValidationState& state)
538
538
{
539
539
// Basic checks that don't depend on any context
540
540
if (tx.vin .empty ())
@@ -563,13 +563,12 @@ bool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fChe
563
563
}
564
564
}
565
565
566
- // Check for duplicate inputs - note that this check is slow so we skip it in CheckBlock
567
- if (fCheckDuplicateInputs ) {
568
- std::set<COutPoint> vInOutPoints;
569
- for (const auto & txin : tx.vin ) {
570
- if (!vInOutPoints.insert (txin.prevout ).second )
571
- return state.DoS (100 , false , REJECT_INVALID, " bad-txns-inputs-duplicate" );
572
- }
566
+ // Check for duplicate inputs
567
+ std::set<COutPoint> vInOutPoints;
568
+ for (const auto & txin : tx.vin )
569
+ {
570
+ if (!vInOutPoints.insert (txin.prevout ).second )
571
+ return state.DoS (100 , false , REJECT_INVALID, " bad-txns-inputs-duplicate" );
573
572
}
574
573
575
574
if (tx.IsCoinBase ()) {
@@ -3414,7 +3413,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
3414
3413
3415
3414
// Check transactions
3416
3415
for (const auto & tx : block.vtx ) {
3417
- if (!CheckTransaction (*tx, state, false ))
3416
+ if (!CheckTransaction (*tx, state))
3418
3417
return state.Invalid (false , state.GetRejectCode (), state.GetRejectReason (),
3419
3418
strprintf (" Transaction check failed (tx hash %s) %s" , tx->GetHash ().ToString (), state.GetDebugMessage ()));
3420
3419
0 commit comments