aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
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/p2p/net_node.inl
parentMerge pull request #4879 (diff)
downloadmonero-570dd3690e501b5c8a3ee8169456539d231b2536.tar.xz
p2p: use vector instead of list for peer lists
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r--src/p2p/net_node.inl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index fbf265fc9..5b845fe15 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -1374,7 +1374,7 @@ namespace nodetool
}
//-----------------------------------------------------------------------------------
template<class t_payload_net_handler>
- bool node_server<t_payload_net_handler>::fix_time_delta(std::list<peerlist_entry>& local_peerlist, time_t local_time, int64_t& delta)
+ bool node_server<t_payload_net_handler>::fix_time_delta(std::vector<peerlist_entry>& local_peerlist, time_t local_time, int64_t& delta)
{
//fix time delta
time_t now = 0;
@@ -1394,10 +1394,10 @@ namespace nodetool
}
//-----------------------------------------------------------------------------------
template<class t_payload_net_handler>
- bool node_server<t_payload_net_handler>::handle_remote_peerlist(const std::list<peerlist_entry>& peerlist, time_t local_time, const epee::net_utils::connection_context_base& context)
+ bool node_server<t_payload_net_handler>::handle_remote_peerlist(const std::vector<peerlist_entry>& peerlist, time_t local_time, const epee::net_utils::connection_context_base& context)
{
int64_t delta = 0;
- std::list<peerlist_entry> peerlist_ = peerlist;
+ std::vector<peerlist_entry> peerlist_ = peerlist;
if(!fix_time_delta(peerlist_, local_time, delta))
return false;
LOG_DEBUG_CC(context, "REMOTE PEERLIST: TIME_DELTA: " << delta << ", remote peerlist size=" << peerlist_.size());
@@ -1779,8 +1779,8 @@ namespace nodetool
template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::log_peerlist()
{
- std::list<peerlist_entry> pl_white;
- std::list<peerlist_entry> pl_gray;
+ std::vector<peerlist_entry> pl_white;
+ std::vector<peerlist_entry> pl_gray;
m_peerlist.get_peerlist_full(pl_gray, pl_white);
MINFO(ENDL << "Peerlist white:" << ENDL << print_peerlist_to_string(pl_white) << ENDL << "Peerlist gray:" << ENDL << print_peerlist_to_string(pl_gray) );
return true;