mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 11:13:23 -03:00
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)
This commit is contained in:
commit
381d0ddc8a
2 changed files with 4 additions and 5 deletions
|
@ -53,11 +53,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t offset = 0;
|
uint16_t offset = 0;
|
||||||
for (size_t i = 0; i < indexes.size(); i++) {
|
for (size_t j = 0; j < indexes.size(); j++) {
|
||||||
if (uint64_t(indexes[i]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())
|
if (uint64_t(indexes[j]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())
|
||||||
throw std::ios_base::failure("indexes overflowed 16 bits");
|
throw std::ios_base::failure("indexes overflowed 16 bits");
|
||||||
indexes[i] = indexes[i] + offset;
|
indexes[j] = indexes[j] + offset;
|
||||||
offset = indexes[i] + 1;
|
offset = indexes[j] + 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (size_t i = 0; i < indexes.size(); i++) {
|
for (size_t i = 0; i < indexes.size(); i++) {
|
||||||
|
|
|
@ -283,7 +283,6 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
||||||
std::vector<CTransaction> vtx_missing;
|
std::vector<CTransaction> vtx_missing;
|
||||||
BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);
|
BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);
|
||||||
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
|
BOOST_CHECK_EQUAL(block.GetHash().ToString(), block2.GetHash().ToString());
|
||||||
bool mutated;
|
|
||||||
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
|
BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());
|
||||||
BOOST_CHECK(!mutated);
|
BOOST_CHECK(!mutated);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue