diff options
| author | Pieter Wuille <[email protected]> | 2017-05-23 13:58:35 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-05-23 14:08:20 -0700 |
| commit | f2f7e97e8cc24cf7a2b7954cb74ecfd0f91a95ad (patch) | |
| tree | 2bb524079ce9233098fb60589b6f2a7f848a47e1 /src/validation.cpp | |
| parent | Merge #9539: [net] Avoid initialization to a value that is never read (diff) | |
| parent | Use range-based for loops (C++11) when looping over vector elements (diff) | |
| download | discoin-f2f7e97e8cc24cf7a2b7954cb74ecfd0f91a95ad.tar.xz discoin-f2f7e97e8cc24cf7a2b7954cb74ecfd0f91a95ad.zip | |
Merge #10347: Use range-based for loops (C++11) when looping over vector elements
211adc0 Use range-based for loops (C++11) when looping over vector elements (practicalswift)
Tree-SHA512: 0e007f20dcef99d3c7a1036265e00f689d69f42e02fd82dd8389f45b52d31947e5f9388de2610d3d9bd9f554915ce0d35ebce561e5ae3a9013956d0ee4937145
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 89358f960..ac16af3ee 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__)); } } |