mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Use range-based for loops (C++11) when looping over vector elements
This commit is contained in:
parent
ea6fde3f1d
commit
211adc074a
5 changed files with 22 additions and 25 deletions
|
|
@ -309,7 +309,6 @@ bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp, bool
|
|||
return EvaluateSequenceLocks(index, lockPair);
|
||||
}
|
||||
|
||||
|
||||
void LimitMempoolSize(CTxMemPool& pool, size_t limit, unsigned long age) {
|
||||
int expired = pool.Expire(GetTime() - age);
|
||||
if (expired != 0) {
|
||||
|
|
@ -2817,8 +2816,8 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const Co
|
|||
|
||||
// No witness data is allowed in blocks that don't commit to witness data, as this would otherwise leave room for spam
|
||||
if (!fHaveWitness) {
|
||||
for (size_t i = 0; i < block.vtx.size(); i++) {
|
||||
if (block.vtx[i]->HasWitness()) {
|
||||
for (const auto& tx : block.vtx) {
|
||||
if (tx->HasWitness()) {
|
||||
return state.DoS(100, false, REJECT_INVALID, "unexpected-witness", true, strprintf("%s : unexpected witness data found", __func__));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue