Skip to content

Commit

Permalink
Do not shadow local variable, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
paveljanik committed Aug 3, 2016
1 parent 5c7a5e1 commit cce3024
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/blockencodings.h
Expand Up @@ -53,11 +53,11 @@ class BlockTransactionsRequest {
}

uint16_t offset = 0;
for (size_t i = 0; i < indexes.size(); i++) {
if (uint64_t(indexes[i]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())
for (size_t j = 0; j < indexes.size(); j++) {
if (uint64_t(indexes[j]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())
throw std::ios_base::failure("indexes overflowed 16 bits");
indexes[i] = indexes[i] + offset;
offset = indexes[i] + 1;
indexes[j] = indexes[j] + offset;
offset = indexes[j] + 1;
}
} else {
for (size_t i = 0; i < indexes.size(); i++) {
Expand Down

0 comments on commit cce3024

Please sign in to comment.