aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-01-06 21:09:03 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-01-06 21:09:03 -0500
commit69e4a2c62d8d2f3e4b92b0bd0d2ddc5c1f0962d6 (patch)
tree146b4d09a32ccfe248a7c3dd59d7ca4aaa3bbcd4 /src
parentMerge pull request #7271 (diff)
parentprotocol: handle receiving a block hash we've not added yet (diff)
downloadmonero-69e4a2c62d8d2f3e4b92b0bd0d2ddc5c1f0962d6.tar.xz
Merge pull request #7266
38a6e6e protocol: handle receiving a block hash we've not added yet (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl13
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 a3020495e..65f721d98 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)
{