mirror of
https://github.com/monero-project/monero.git
synced 2026-01-05 01:07:21 -08:00
Merge pull request #2838
310b790a make connection_id a string in RPC (moneromooo-monero)
This commit is contained in:
@@ -1747,12 +1747,13 @@ namespace cryptonote
|
||||
res.peers.push_back({c});
|
||||
const cryptonote::block_queue &block_queue = m_p2p.get_payload_object().get_block_queue();
|
||||
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)
|
||||
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, address});
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user