aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-12-05 22:25:27 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-12-07 13:20:34 +0000
commit570dd3690e501b5c8a3ee8169456539d231b2536 (patch)
tree6b58dd79182f999408bae136a95f887e5348fdb5 /src/rpc
parentMerge pull request #4879 (diff)
downloadmonero-570dd3690e501b5c8a3ee8169456539d231b2536.tar.xz
p2p: use vector instead of list for peer lists
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index cefba39f7..9c0f84450 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)