diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-01-06 20:39:07 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-01-06 20:39:07 +0200 |
commit | 577a8f5c8431d385bf9d11c30b5e3e8855c16cca (patch) | |
tree | ff5368085b0eba24d4c6725ac40ae0c18ead8887 /src/rpc | |
parent | Merge pull request #4951 (diff) | |
parent | p2p: use vector instead of list for peer lists (diff) | |
download | monero-577a8f5c8431d385bf9d11c30b5e3e8855c16cca.tar.xz |
Merge pull request #4952
570dd369 p2p: use vector instead of list for peer lists (moneromooo-monero)
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/core_rpc_server.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 3851af3c8..0aa25bda7 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -857,11 +857,11 @@ namespace cryptonote bool core_rpc_server::on_get_peer_list(const COMMAND_RPC_GET_PEER_LIST::request& req, COMMAND_RPC_GET_PEER_LIST::response& res) { PERF_TIMER(on_get_peer_list); - std::list<nodetool::peerlist_entry> white_list; - std::list<nodetool::peerlist_entry> gray_list; + std::vector<nodetool::peerlist_entry> white_list; + std::vector<nodetool::peerlist_entry> gray_list; m_p2p.get_peerlist_manager().get_peerlist_full(gray_list, white_list); - + res.white_list.reserve(white_list.size()); for (auto & entry : white_list) { if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID) @@ -871,6 +871,7 @@ namespace cryptonote res.white_list.emplace_back(entry.id, entry.adr.str(), entry.last_seen); } + res.gray_list.reserve(gray_list.size()); for (auto & entry : gray_list) { if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID) |