diff options
| author | practicalswift <[email protected]> | 2017-05-18 09:42:14 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2017-05-19 09:56:16 +0200 |
| commit | 211adc074a662505f2b54f3f2755f4fefc167aac (patch) | |
| tree | 75ae8f49fcd201cc359664317df049f04c78c41b /src/validation.cpp | |
| parent | Merge #8329: Consensus: MOVEONLY: Move functions for tx verification (diff) | |
| download | discoin-211adc074a662505f2b54f3f2755f4fefc167aac.tar.xz discoin-211adc074a662505f2b54f3f2755f4fefc167aac.zip | |
Use range-based for loops (C++11) when looping over vector elements
Diffstat (limited to 'src/validation.cpp')
| -rw-r--r-- | src/validation.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 73466b9df..77cd5985a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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__)); } } |