aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-12-08 17:55:24 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-12-10 22:00:01 +0000
commitd729730d380fa25f0b122dd4ef6f331a35748a4b (patch)
tree6e7725c03947b47272261de132abb166e11749b8 /src/rpc
parentMerge pull request #7109 (diff)
downloadmonero-d729730d380fa25f0b122dd4ef6f331a35748a4b.tar.xz
protocol: drop origin IP if a block fails to verify in sync mode
It would otherwise be possible for a peer to send bad blocks, then disconnect and reconnect again, escaping bans
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index f028fe06f..f7d5bf03c 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2913,11 +2913,7 @@ namespace cryptonote
block_queue.foreach([&](const cryptonote::block_queue::span &span) {
const std::string span_connection_id = epee::string_tools::pod_to_hex(span.connection_id);
uint32_t speed = (uint32_t)(100.0f * block_queue.get_speed(span.connection_id) + 0.5f);
- std::string address = "";
- for (const auto &c: m_p2p.get_payload_object().get_connections())
- if (c.connection_id == span_connection_id)
- address = c.address;
- res.spans.push_back({span.start_block_height, span.nblocks, span_connection_id, (uint32_t)(span.rate + 0.5f), speed, span.size, address});
+ res.spans.push_back({span.start_block_height, span.nblocks, span_connection_id, (uint32_t)(span.rate + 0.5f), speed, span.size, span.origin.str()});
return true;
});
res.overview = block_queue.get_overview(res.height);