mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-23 11:23:26 +01:00
blockchain: don't try to use hash check array after it's freed
It's freed when we've synced past its end, but we might still find an old chain somewhere
This commit is contained in:
parent
ed67e5c001
commit
d6a0ae96c6
@ -3753,6 +3753,10 @@ uint64_t Blockchain::prevalidate_block_hashes(uint64_t height, const std::list<c
|
|||||||
if (height >= m_blocks_hash_of_hashes.size() * HASH_OF_HASHES_STEP)
|
if (height >= m_blocks_hash_of_hashes.size() * HASH_OF_HASHES_STEP)
|
||||||
return hashes.size();
|
return hashes.size();
|
||||||
|
|
||||||
|
// if we're getting old blocks, we might have jettisoned the hashes already
|
||||||
|
if (m_blocks_hash_check.empty())
|
||||||
|
return hashes.size();
|
||||||
|
|
||||||
// find hashes encompassing those block
|
// find hashes encompassing those block
|
||||||
size_t first_index = height / HASH_OF_HASHES_STEP;
|
size_t first_index = height / HASH_OF_HASHES_STEP;
|
||||||
size_t last_index = (height + hashes.size() - 1) / HASH_OF_HASHES_STEP;
|
size_t last_index = (height + hashes.size() - 1) / HASH_OF_HASHES_STEP;
|
||||||
|
Loading…
Reference in New Issue
Block a user