@@ -785,7 +785,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
785
785
return true ;
786
786
if ((int64_t )tx.nLockTime < ((int64_t )tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t )nBlockHeight : nBlockTime))
787
787
return true ;
788
- BOOST_FOREACH (const CTxIn & txin, tx.vin ) {
788
+ for (const auto & txin : tx.vin ) {
789
789
if (!(txin.nSequence == CTxIn::SEQUENCE_FINAL))
790
790
return false ;
791
791
}
@@ -999,11 +999,11 @@ bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp, bool
999
999
unsigned int GetLegacySigOpCount (const CTransaction& tx)
1000
1000
{
1001
1001
unsigned int nSigOps = 0 ;
1002
- BOOST_FOREACH (const CTxIn & txin, tx.vin )
1002
+ for (const auto & txin : tx.vin )
1003
1003
{
1004
1004
nSigOps += txin.scriptSig .GetSigOpCount (false );
1005
1005
}
1006
- BOOST_FOREACH (const CTxOut & txout, tx.vout )
1006
+ for (const auto & txout : tx.vout )
1007
1007
{
1008
1008
nSigOps += txout.scriptPubKey .GetSigOpCount (false );
1009
1009
}
@@ -1061,7 +1061,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
1061
1061
1062
1062
// Check for negative or overflow output values
1063
1063
CAmount nValueOut = 0 ;
1064
- BOOST_FOREACH (const CTxOut & txout, tx.vout )
1064
+ for (const auto & txout : tx.vout )
1065
1065
{
1066
1066
if (txout.nValue < 0 )
1067
1067
return state.DoS (100 , false , REJECT_INVALID, " bad-txns-vout-negative" );
@@ -1074,7 +1074,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
1074
1074
1075
1075
// Check for duplicate inputs
1076
1076
set<COutPoint> vInOutPoints;
1077
- BOOST_FOREACH (const CTxIn & txin, tx.vin )
1077
+ for (const auto & txin : tx.vin )
1078
1078
{
1079
1079
if (vInOutPoints.count (txin.prevout ))
1080
1080
return state.DoS (100 , false , REJECT_INVALID, " bad-txns-inputs-duplicate" );
@@ -1088,7 +1088,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
1088
1088
}
1089
1089
else
1090
1090
{
1091
- BOOST_FOREACH (const CTxIn & txin, tx.vin )
1091
+ for (const auto & txin : tx.vin )
1092
1092
if (txin.prevout .IsNull ())
1093
1093
return state.DoS (10 , false , REJECT_INVALID, " bad-txns-prevout-null" );
1094
1094
}
@@ -3401,13 +3401,13 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
3401
3401
return state.DoS (100 , false , REJECT_INVALID, " bad-cb-multiple" , false , " more than one coinbase" );
3402
3402
3403
3403
// Check transactions
3404
- BOOST_FOREACH (const CTransaction & tx, block.vtx )
3404
+ for (const auto & tx : block.vtx )
3405
3405
if (!CheckTransaction (tx, state))
3406
3406
return state.Invalid (false , state.GetRejectCode (), state.GetRejectReason (),
3407
3407
strprintf (" Transaction check failed (tx hash %s) %s" , tx.GetHash ().ToString (), state.GetDebugMessage ()));
3408
3408
3409
3409
unsigned int nSigOps = 0 ;
3410
- BOOST_FOREACH (const CTransaction & tx, block.vtx )
3410
+ for (const auto & tx : block.vtx )
3411
3411
{
3412
3412
nSigOps += GetLegacySigOpCount (tx);
3413
3413
}
@@ -3538,7 +3538,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
3538
3538
: block.GetBlockTime ();
3539
3539
3540
3540
// Check that all transactions are finalized
3541
- BOOST_FOREACH (const CTransaction & tx, block.vtx ) {
3541
+ for (const auto & tx : block.vtx ) {
3542
3542
if (!IsFinalTx (tx, nHeight, nLockTimeCutoff)) {
3543
3543
return state.DoS (10 , false , REJECT_INVALID, " bad-txns-nonfinal" , false , " non-final transaction" );
3544
3544
}
0 commit comments