Skip to content

Commit 381d0dd

Browse files
committed
Merge #8449: [Trivial] Do not shadow local variable, cleanup
a159f25 Remove redundand (and shadowing) declaration (Pavel Janík) cce3024 Do not shadow local variable, cleanup (Pavel Janík)
2 parents 6f939c9 + a159f25 commit 381d0dd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/blockencodings.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ class BlockTransactionsRequest {
5353
}
5454

5555
uint16_t offset = 0;
56-
for (size_t i = 0; i < indexes.size(); i++) {
57-
if (uint64_t(indexes[i]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())
56+
for (size_t j = 0; j < indexes.size(); j++) {
57+
if (uint64_t(indexes[j]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())
5858
throw std::ios_base::failure("indexes overflowed 16 bits");
59-
indexes[i] = indexes[i] + offset;
60-
offset = indexes[i] + 1;
59+
indexes[j] = indexes[j] + offset;
60+
offset = indexes[j] + 1;
6161
}
6262
} else {
6363
for (size_t i = 0; i < indexes.size(); i++) {

src/test/blockencodings_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
283283
std::vector<CTransaction> vtx_missing;
284284
BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);
285285
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
286-
bool mutated;
287286
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
288287
BOOST_CHECK(!mutated);
289288
}

0 commit comments

Comments
 (0)