diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2021-01-02 18:28:09 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2021-01-02 22:10:31 +0000 |
commit | 38a6e6eb261bb1e84fdbe62b0beb05967a54149b (patch) | |
tree | 9cc1da813beed775368ba99b0348393afff63906 /src | |
parent | Merge pull request #7250 (diff) | |
download | monero-38a6e6eb261bb1e84fdbe62b0beb05967a54149b.tar.xz |
protocol: handle receiving a block hash we've not added yet
Diffstat (limited to 'src')
-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 bd39077ae..e69e5673c 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) { |