@@ -788,7 +788,7 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
788
788
return true ;
789
789
if ((int64_t )tx.nLockTime < ((int64_t )tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t )nBlockHeight : nBlockTime))
790
790
return true ;
791
- BOOST_FOREACH (const CTxIn & txin, tx.vin ) {
791
+ for (const auto & txin : tx.vin ) {
792
792
if (!(txin.nSequence == CTxIn::SEQUENCE_FINAL))
793
793
return false ;
794
794
}
@@ -1002,11 +1002,11 @@ bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp, bool
1002
1002
unsigned int GetLegacySigOpCount (const CTransaction& tx)
1003
1003
{
1004
1004
unsigned int nSigOps = 0 ;
1005
- BOOST_FOREACH (const CTxIn & txin, tx.vin )
1005
+ for (const auto & txin : tx.vin )
1006
1006
{
1007
1007
nSigOps += txin.scriptSig .GetSigOpCount (false );
1008
1008
}
1009
- BOOST_FOREACH (const CTxOut & txout, tx.vout )
1009
+ for (const auto & txout : tx.vout )
1010
1010
{
1011
1011
nSigOps += txout.scriptPubKey .GetSigOpCount (false );
1012
1012
}
@@ -1064,7 +1064,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
1064
1064
1065
1065
// Check for negative or overflow output values
1066
1066
CAmount nValueOut = 0 ;
1067
- BOOST_FOREACH (const CTxOut & txout, tx.vout )
1067
+ for (const auto & txout : tx.vout )
1068
1068
{
1069
1069
if (txout.nValue < 0 )
1070
1070
return state.DoS (100 , false , REJECT_INVALID, " bad-txns-vout-negative" );
@@ -1077,7 +1077,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
1077
1077
1078
1078
// Check for duplicate inputs
1079
1079
set<COutPoint> vInOutPoints;
1080
- BOOST_FOREACH (const CTxIn & txin, tx.vin )
1080
+ for (const auto & txin : tx.vin )
1081
1081
{
1082
1082
if (vInOutPoints.count (txin.prevout ))
1083
1083
return state.DoS (100 , false , REJECT_INVALID, " bad-txns-inputs-duplicate" );
@@ -1091,7 +1091,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state)
1091
1091
}
1092
1092
else
1093
1093
{
1094
- BOOST_FOREACH (const CTxIn & txin, tx.vin )
1094
+ for (const auto & txin : tx.vin )
1095
1095
if (txin.prevout .IsNull ())
1096
1096
return state.DoS (10 , false , REJECT_INVALID, " bad-txns-prevout-null" );
1097
1097
}
@@ -3404,13 +3404,13 @@ bool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::P
3404
3404
return state.DoS (100 , false , REJECT_INVALID, " bad-cb-multiple" , false , " more than one coinbase" );
3405
3405
3406
3406
// Check transactions
3407
- BOOST_FOREACH (const CTransaction & tx, block.vtx )
3407
+ for (const auto & tx : block.vtx )
3408
3408
if (!CheckTransaction (tx, state))
3409
3409
return state.Invalid (false , state.GetRejectCode (), state.GetRejectReason (),
3410
3410
strprintf (" Transaction check failed (tx hash %s) %s" , tx.GetHash ().ToString (), state.GetDebugMessage ()));
3411
3411
3412
3412
unsigned int nSigOps = 0 ;
3413
- BOOST_FOREACH (const CTransaction & tx, block.vtx )
3413
+ for (const auto & tx : block.vtx )
3414
3414
{
3415
3415
nSigOps += GetLegacySigOpCount (tx);
3416
3416
}
@@ -3541,7 +3541,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
3541
3541
: block.GetBlockTime ();
3542
3542
3543
3543
// Check that all transactions are finalized
3544
- BOOST_FOREACH (const CTransaction & tx, block.vtx ) {
3544
+ for (const auto & tx : block.vtx ) {
3545
3545
if (!IsFinalTx (tx, nHeight, nLockTimeCutoff)) {
3546
3546
return state.DoS (10 , false , REJECT_INVALID, " bad-txns-nonfinal" , false , " non-final transaction" );
3547
3547
}
0 commit comments