diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-01-06 21:09:36 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-01-06 21:09:36 -0500 |
commit | 83fa752a84c35ea134e86000968c8de9b092556c (patch) | |
tree | bcd8935fa36e693f2d3d721e737d6e3b37fbda48 | |
parent | Merge pull request #7248 (diff) | |
parent | protocol: handle receiving a block hash we've not added yet (diff) | |
download | monero-83fa752a84c35ea134e86000968c8de9b092556c.tar.xz |
Merge pull request #7267
c2295f5 protocol: handle receiving a block hash we've not added yet (moneromooo-monero)
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 590b8440b..177ca1713 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -2593,11 +2593,16 @@ skip: } int where; const bool have_block = m_core.have_block_unlocked(arg.m_block_ids[i], &where); - if (first && !have_block) + if (first) { - LOG_ERROR_CCONTEXT("First block hash is unknown, dropping connection"); - drop_connection_with_score(context, 5, false); - return 1; + if (!have_block && !m_block_queue.requested(arg.m_block_ids[i]) && !m_block_queue.have(arg.m_block_ids[i])) + { + LOG_ERROR_CCONTEXT("First block hash is unknown, dropping connection"); + drop_connection_with_score(context, 5, false); + return 1; + } + if (!have_block) + expect_unknown = true; } if (!first) { |