mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
Merge pull request #3248
d6a0ae96
blockchain: don't try to use hash check array after it's freed (moneromooo-monero)
This commit is contained in:
commit
24d8f9237f
1 changed files with 4 additions and 0 deletions
|
@ -3754,6 +3754,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)
|
||||
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
|
||||
size_t first_index = height / HASH_OF_HASHES_STEP;
|
||||
size_t last_index = (height + hashes.size() - 1) / HASH_OF_HASHES_STEP;
|
||||
|
|
Loading…
Reference in a new issue