mirror of
https://github.com/monero-project/monero.git
synced 2024-11-17 16:27:39 +00:00
cryptonote_protocol: fix corner case looping asking for same block hashes
This commit is contained in:
parent
8512a83572
commit
b927f0b17e
1 changed files with 4 additions and 0 deletions
|
@ -1414,6 +1414,10 @@ skip:
|
||||||
// take out blocks we already have
|
// take out blocks we already have
|
||||||
while (!context.m_needed_objects.empty() && m_core.have_block(context.m_needed_objects.front()))
|
while (!context.m_needed_objects.empty() && m_core.have_block(context.m_needed_objects.front()))
|
||||||
{
|
{
|
||||||
|
// if we're popping the last hash, record it so we can ask again from that hash,
|
||||||
|
// this prevents never being able to progress on peers we get old hash lists from
|
||||||
|
if (context.m_needed_objects.size() == 1)
|
||||||
|
context.m_last_known_hash = context.m_needed_objects.front();
|
||||||
context.m_needed_objects.pop_front();
|
context.m_needed_objects.pop_front();
|
||||||
}
|
}
|
||||||
const uint64_t first_block_height = context.m_last_response_height - context.m_needed_objects.size() + 1;
|
const uint64_t first_block_height = context.m_last_response_height - context.m_needed_objects.size() + 1;
|
||||||
|
|
Loading…
Reference in a new issue