diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-12-02 09:23:22 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-12-02 09:23:22 +0200 |
commit | ed8fc8ac1c694344e30d07f1cb1a5cb904b13f52 (patch) | |
tree | c63e40a023ccc16bedbd2ec4447bc94b2f0a6b0c /src/rpc | |
parent | Merge pull request #2835 (diff) | |
parent | make connection_id a string in RPC (diff) | |
download | monero-ed8fc8ac1c694344e30d07f1cb1a5cb904b13f52.tar.xz |
Merge pull request #2838
310b790a make connection_id a string in RPC (moneromooo-monero)
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 5 | ||||
-rw-r--r-- | src/rpc/core_rpc_server_commands_defs.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index e9a6a18aa..f146dae3e 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -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; }); diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index d27d5611e..58a6ce9e1 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -2077,7 +2077,7 @@ namespace cryptonote { uint64_t start_block_height; uint64_t nblocks; - boost::uuids::uuid connection_id; + std::string connection_id; uint32_t rate; uint32_t speed; uint64_t size; @@ -2086,7 +2086,7 @@ namespace cryptonote BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(start_block_height) KV_SERIALIZE(nblocks) - KV_SERIALIZE_VAL_POD_AS_BLOB(connection_id) + KV_SERIALIZE(connection_id) KV_SERIALIZE(rate) KV_SERIALIZE(speed) KV_SERIALIZE(size) |