Skip to content

Commit

Permalink
Merge bitcoin#8449: [Trivial] Do not shadow local variable, cleanup
Browse files Browse the repository at this point in the history
a159f25 Remove redundand (and shadowing) declaration (Pavel Janík)
cce3024 Do not shadow local variable, cleanup (Pavel Janík)
  • Loading branch information
laanwj committed Sep 2, 2016
2 parents 6f939c9 + a159f25 commit 381d0dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/blockencodings.h
Original file line number Diff line number Diff line change
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
1 change: 0 additions & 1 deletion src/test/blockencodings_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
std::vector<CTransaction> vtx_missing;
BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
bool mutated;
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
BOOST_CHECK(!mutated);
}
Expand Down

0 comments on commit 381d0dd

Please sign in to comment.