Monero
net_peerlist.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2018, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
31 #pragma once
32 
33 #include <list>
34 #include <set>
35 #include <map>
36 #include <boost/archive/binary_iarchive.hpp>
37 #include <boost/archive/portable_binary_oarchive.hpp>
38 #include <boost/archive/portable_binary_iarchive.hpp>
39 #include <boost/serialization/version.hpp>
40 
41 #include <boost/multi_index_container.hpp>
42 #include <boost/multi_index/ordered_index.hpp>
43 #include <boost/multi_index/identity.hpp>
44 #include <boost/multi_index/member.hpp>
45 #include <boost/range/adaptor/reversed.hpp>
46 
47 
48 #include "syncobj.h"
49 #include "net/local_ip.h"
50 #include "p2p_protocol_defs.h"
51 #include "cryptonote_config.h"
53 
54 
55 #define CURRENT_PEERLIST_STORAGE_ARCHIVE_VER 6
56 
57 namespace nodetool
58 {
59 
60 
61  /************************************************************************/
62  /* */
63  /************************************************************************/
65  {
66  public:
67  bool init(bool allow_local_ip);
68  bool deinit();
69  size_t get_white_peers_count(){CRITICAL_REGION_LOCAL(m_peerlist_lock); return m_peers_white.size();}
70  size_t get_gray_peers_count(){CRITICAL_REGION_LOCAL(m_peerlist_lock); return m_peers_gray.size();}
71  bool merge_peerlist(const std::list<peerlist_entry>& outer_bs);
72  bool get_peerlist_head(std::list<peerlist_entry>& bs_head, uint32_t depth = P2P_DEFAULT_PEERS_IN_HANDSHAKE);
73  bool get_peerlist_full(std::list<peerlist_entry>& pl_gray, std::list<peerlist_entry>& pl_white);
74  bool get_white_peer_by_index(peerlist_entry& p, size_t i);
75  bool get_gray_peer_by_index(peerlist_entry& p, size_t i);
76  bool append_with_peer_white(const peerlist_entry& pr);
77  bool append_with_peer_gray(const peerlist_entry& pr);
79  bool set_peer_just_seen(peerid_type peer, const epee::net_utils::network_address& addr);
80  bool set_peer_unreachable(const peerlist_entry& pr);
81  bool is_host_allowed(const epee::net_utils::network_address &address);
83  bool remove_from_peer_gray(const peerlist_entry& pe);
84  bool get_and_empty_anchor_peerlist(std::vector<anchor_peerlist_entry>& apl);
85  bool remove_from_peer_anchor(const epee::net_utils::network_address& addr);
86 
87  private:
88  struct by_time{};
89  struct by_id{};
90  struct by_addr{};
91 
93  {
96  {
97  e.id = m_ple.id;
98  }
99  private:
101  };
102 
103  struct modify_all
104  {
105  modify_all(const peerlist_entry& ple):m_ple(ple){}
107  {
108  e = m_ple;
109  }
110  private:
112  };
113 
115  {
116  modify_last_seen(time_t last_seen):m_last_seen(last_seen){}
118  {
120  }
121  private:
122  time_t m_last_seen;
123  };
124 
125 
126  typedef boost::multi_index_container<
128  boost::multi_index::indexed_by<
129  // access by peerlist_entry::net_adress
130  boost::multi_index::ordered_unique<boost::multi_index::tag<by_addr>, boost::multi_index::member<peerlist_entry,epee::net_utils::network_address,&peerlist_entry::adr> >,
131  // sort by peerlist_entry::last_seen<
132  boost::multi_index::ordered_non_unique<boost::multi_index::tag<by_time>, boost::multi_index::member<peerlist_entry,int64_t,&peerlist_entry::last_seen> >
133  >
135 
136  typedef boost::multi_index_container<
138  boost::multi_index::indexed_by<
139  // access by peerlist_entry::id<
140  boost::multi_index::ordered_unique<boost::multi_index::tag<by_id>, boost::multi_index::member<peerlist_entry,uint64_t,&peerlist_entry::id> >,
141  // access by peerlist_entry::net_adress
142  boost::multi_index::ordered_unique<boost::multi_index::tag<by_addr>, boost::multi_index::member<peerlist_entry,epee::net_utils::network_address,&peerlist_entry::adr> >,
143  // sort by peerlist_entry::last_seen<
144  boost::multi_index::ordered_non_unique<boost::multi_index::tag<by_time>, boost::multi_index::member<peerlist_entry,int64_t,&peerlist_entry::last_seen> >
145  >
147 
148  typedef boost::multi_index_container<
150  boost::multi_index::indexed_by<
151  // access by anchor_peerlist_entry::net_adress
152  boost::multi_index::ordered_unique<boost::multi_index::tag<by_addr>, boost::multi_index::member<anchor_peerlist_entry,epee::net_utils::network_address,&anchor_peerlist_entry::adr> >,
153  // sort by anchor_peerlist_entry::first_seen
154  boost::multi_index::ordered_non_unique<boost::multi_index::tag<by_time>, boost::multi_index::member<anchor_peerlist_entry,int64_t,&anchor_peerlist_entry::first_seen> >
155  >
157  public:
158 
159  template <class Archive, class List, class Element, class t_version_type>
160  void serialize_peers(Archive &a, List &list, Element ple, const t_version_type ver)
161  {
162  if (typename Archive::is_saving())
163  {
164  uint64_t size = list.size();
165  a & size;
166  for (auto p: list)
167  {
168  a & p;
169  }
170  }
171  else
172  {
173  uint64_t size;
174  a & size;
175  list.clear();
176  while (size--)
177  {
178  a & ple;
179  list.insert(ple);
180  }
181  }
182  }
183 
184  template <class Archive, class t_version_type>
185  void serialize(Archive &a, const t_version_type ver)
186  {
187  // at v6, we drop existing peerlists, because annoying change
188  if (ver < 6)
189  return;
190 
191  CRITICAL_REGION_LOCAL(m_peerlist_lock);
192 
193 #if 0
194  // trouble loading more than one peer, can't find why
195  a & m_peers_white;
196  a & m_peers_gray;
197  a & m_peers_anchor;
198 #else
202 #endif
203  }
204 
205  private:
207  void trim_white_peerlist();
208  void trim_gray_peerlist();
209 
211  epee::critical_section m_peerlist_lock;
212  std::string m_config_folder;
214 
215 
219  };
220  //--------------------------------------------------------------------------------------------------
221  inline
222  bool peerlist_manager::init(bool allow_local_ip)
223  {
224  m_allow_local_ip = allow_local_ip;
225  return true;
226  }
227  //--------------------------------------------------------------------------------------------------
228  inline
230  {
231  return true;
232  }
233  //--------------------------------------------------------------------------------------------------
234  inline
236  {
237  for(auto x: pio)
238  {
239  auto by_addr_it = pi.get<by_addr>().find(x.adr);
240  if(by_addr_it == pi.get<by_addr>().end())
241  {
242  pi.insert(x);
243  }
244  }
245 
246  return true;
247  }
248  //--------------------------------------------------------------------------------------------------
250  {
252  {
253  peers_indexed::index<by_time>::type& sorted_index=m_peers_gray.get<by_time>();
254  sorted_index.erase(sorted_index.begin());
255  }
256  }
257  //--------------------------------------------------------------------------------------------------
259  {
261  {
262  peers_indexed::index<by_time>::type& sorted_index=m_peers_white.get<by_time>();
263  sorted_index.erase(sorted_index.begin());
264  }
265  }
266  //--------------------------------------------------------------------------------------------------
267  inline
268  bool peerlist_manager::merge_peerlist(const std::list<peerlist_entry>& outer_bs)
269  {
270  CRITICAL_REGION_LOCAL(m_peerlist_lock);
271  for(const peerlist_entry& be: outer_bs)
272  {
274  }
275  // delete extra elements
277  return true;
278  }
279  //--------------------------------------------------------------------------------------------------
280  inline
282  {
283  CRITICAL_REGION_LOCAL(m_peerlist_lock);
284  if(i >= m_peers_white.size())
285  return false;
286 
287  peers_indexed::index<by_time>::type& by_time_index = m_peers_white.get<by_time>();
288  p = *epee::misc_utils::move_it_backward(--by_time_index.end(), i);
289  return true;
290  }
291  //--------------------------------------------------------------------------------------------------
292  inline
294  {
295  CRITICAL_REGION_LOCAL(m_peerlist_lock);
296  if(i >= m_peers_gray.size())
297  return false;
298 
299  peers_indexed::index<by_time>::type& by_time_index = m_peers_gray.get<by_time>();
300  p = *epee::misc_utils::move_it_backward(--by_time_index.end(), i);
301  return true;
302  }
303  //--------------------------------------------------------------------------------------------------
304  inline
305  bool peerlist_manager::is_host_allowed(const epee::net_utils::network_address &address)
306  {
307  //never allow loopback ip
308  if(address.is_loopback())
309  return false;
310 
311  if(!m_allow_local_ip && address.is_local())
312  return false;
313 
314  return true;
315  }
316  //--------------------------------------------------------------------------------------------------
317  inline
318  bool peerlist_manager::get_peerlist_head(std::list<peerlist_entry>& bs_head, uint32_t depth)
319  {
320 
321  CRITICAL_REGION_LOCAL(m_peerlist_lock);
322  peers_indexed::index<by_time>::type& by_time_index=m_peers_white.get<by_time>();
323  uint32_t cnt = 0;
324  for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index))
325  {
326  if(!vl.last_seen)
327  continue;
328 
329  if(cnt++ >= depth)
330  break;
331 
332  bs_head.push_back(vl);
333  }
334  return true;
335  }
336  //--------------------------------------------------------------------------------------------------
337  inline
338  bool peerlist_manager::get_peerlist_full(std::list<peerlist_entry>& pl_gray, std::list<peerlist_entry>& pl_white)
339  {
340  CRITICAL_REGION_LOCAL(m_peerlist_lock);
341  peers_indexed::index<by_time>::type& by_time_index_gr=m_peers_gray.get<by_time>();
342  for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index_gr))
343  {
344  pl_gray.push_back(vl);
345  }
346 
347  peers_indexed::index<by_time>::type& by_time_index_wt=m_peers_white.get<by_time>();
348  for(const peers_indexed::value_type& vl: boost::adaptors::reverse(by_time_index_wt))
349  {
350  pl_white.push_back(vl);
351  }
352 
353  return true;
354  }
355  //--------------------------------------------------------------------------------------------------
356  inline
357  bool peerlist_manager::set_peer_just_seen(peerid_type peer, const epee::net_utils::network_address& addr)
358  {
359  TRY_ENTRY();
360  CRITICAL_REGION_LOCAL(m_peerlist_lock);
361  //find in white list
362  peerlist_entry ple;
363  ple.adr = addr;
364  ple.id = peer;
365  ple.last_seen = time(NULL);
366  return append_with_peer_white(ple);
367  CATCH_ENTRY_L0("peerlist_manager::set_peer_just_seen()", false);
368  }
369  //--------------------------------------------------------------------------------------------------
370  inline
372  {
373  TRY_ENTRY();
374  if(!is_host_allowed(ple.adr))
375  return true;
376 
377  CRITICAL_REGION_LOCAL(m_peerlist_lock);
378  //find in white list
379  auto by_addr_it_wt = m_peers_white.get<by_addr>().find(ple.adr);
380  if(by_addr_it_wt == m_peers_white.get<by_addr>().end())
381  {
382  //put new record into white list
383  m_peers_white.insert(ple);
385  }else
386  {
387  //update record in white list
388  m_peers_white.replace(by_addr_it_wt, ple);
389  }
390  //remove from gray list, if need
391  auto by_addr_it_gr = m_peers_gray.get<by_addr>().find(ple.adr);
392  if(by_addr_it_gr != m_peers_gray.get<by_addr>().end())
393  {
394  m_peers_gray.erase(by_addr_it_gr);
395  }
396  return true;
397  CATCH_ENTRY_L0("peerlist_manager::append_with_peer_white()", false);
398  }
399  //--------------------------------------------------------------------------------------------------
400  inline
402  {
403  TRY_ENTRY();
404  if(!is_host_allowed(ple.adr))
405  return true;
406 
407  CRITICAL_REGION_LOCAL(m_peerlist_lock);
408  //find in white list
409  auto by_addr_it_wt = m_peers_white.get<by_addr>().find(ple.adr);
410  if(by_addr_it_wt != m_peers_white.get<by_addr>().end())
411  return true;
412 
413  //update gray list
414  auto by_addr_it_gr = m_peers_gray.get<by_addr>().find(ple.adr);
415  if(by_addr_it_gr == m_peers_gray.get<by_addr>().end())
416  {
417  //put new record into white list
418  m_peers_gray.insert(ple);
420  }else
421  {
422  //update record in white list
423  m_peers_gray.replace(by_addr_it_gr, ple);
424  }
425  return true;
426  CATCH_ENTRY_L0("peerlist_manager::append_with_peer_gray()", false);
427  }
428  //--------------------------------------------------------------------------------------------------
429  inline
431  {
432  TRY_ENTRY();
433 
434  CRITICAL_REGION_LOCAL(m_peerlist_lock);
435 
436  auto by_addr_it_anchor = m_peers_anchor.get<by_addr>().find(ple.adr);
437 
438  if(by_addr_it_anchor == m_peers_anchor.get<by_addr>().end()) {
439  m_peers_anchor.insert(ple);
440  }
441 
442  return true;
443 
444  CATCH_ENTRY_L0("peerlist_manager::append_with_peer_anchor()", false);
445  }
446  //--------------------------------------------------------------------------------------------------
447  inline
449  {
450  TRY_ENTRY();
451 
452  CRITICAL_REGION_LOCAL(m_peerlist_lock);
453 
454  if (m_peers_gray.empty()) {
455  return false;
456  }
457 
458  size_t random_index = crypto::rand<size_t>() % m_peers_gray.size();
459 
460  peers_indexed::index<by_time>::type& by_time_index = m_peers_gray.get<by_time>();
461  pe = *epee::misc_utils::move_it_backward(--by_time_index.end(), random_index);
462 
463  return true;
464 
465  CATCH_ENTRY_L0("peerlist_manager::get_random_gray_peer()", false);
466  }
467  //--------------------------------------------------------------------------------------------------
468  inline
470  {
471  TRY_ENTRY();
472 
473  CRITICAL_REGION_LOCAL(m_peerlist_lock);
474 
475  peers_indexed::index_iterator<by_addr>::type iterator = m_peers_gray.get<by_addr>().find(pe.adr);
476 
477  if (iterator != m_peers_gray.get<by_addr>().end()) {
478  m_peers_gray.erase(iterator);
479  }
480 
481  return true;
482 
483  CATCH_ENTRY_L0("peerlist_manager::remove_from_peer_gray()", false);
484  }
485  //--------------------------------------------------------------------------------------------------
486  inline
487  bool peerlist_manager::get_and_empty_anchor_peerlist(std::vector<anchor_peerlist_entry>& apl)
488  {
489  TRY_ENTRY();
490 
491  CRITICAL_REGION_LOCAL(m_peerlist_lock);
492 
493  auto begin = m_peers_anchor.get<by_time>().begin();
494  auto end = m_peers_anchor.get<by_time>().end();
495 
496  std::for_each(begin, end, [&apl](const anchor_peerlist_entry &a) {
497  apl.push_back(a);
498  });
499 
500  m_peers_anchor.get<by_time>().clear();
501 
502  return true;
503 
504  CATCH_ENTRY_L0("peerlist_manager::get_and_empty_anchor_peerlist()", false);
505  }
506  //--------------------------------------------------------------------------------------------------
507  inline
508  bool peerlist_manager::remove_from_peer_anchor(const epee::net_utils::network_address& addr)
509  {
510  TRY_ENTRY();
511 
512  CRITICAL_REGION_LOCAL(m_peerlist_lock);
513 
514  anchor_peers_indexed::index_iterator<by_addr>::type iterator = m_peers_anchor.get<by_addr>().find(addr);
515 
516  if (iterator != m_peers_anchor.get<by_addr>().end()) {
517  m_peers_anchor.erase(iterator);
518  }
519 
520  return true;
521 
522  CATCH_ENTRY_L0("peerlist_manager::remove_from_peer_anchor()", false);
523  }
524  //--------------------------------------------------------------------------------------------------
525 }
526 
size_t get_white_peers_count()
Definition: net_peerlist.h:69
int64_t last_seen
Definition: p2p_protocol_defs.h:74
Definition: net_peerlist.h:103
friend class boost::serialization::access
Definition: net_peerlist.h:210
void serialize(Archive &a, const t_version_type ver)
Definition: net_peerlist.h:185
bool set_peer_just_seen(peerid_type peer, const epee::net_utils::network_address &addr)
Definition: net_peerlist.h:357
bool append_with_peer_anchor(const anchor_peerlist_entry &ple)
Definition: net_peerlist.h:430
bool get_and_empty_anchor_peerlist(std::vector< anchor_peerlist_entry > &apl)
Definition: net_peerlist.h:487
bool get_peerlist_head(std::list< peerlist_entry > &bs_head, uint32_t depth=P2P_DEFAULT_PEERS_IN_HANDSHAKE)
Definition: net_peerlist.h:318
AddressType adr
Definition: p2p_protocol_defs.h:72
peerlist_entry_base< epee::net_utils::network_address > peerlist_entry
Definition: p2p_protocol_defs.h:82
AddressType adr
Definition: p2p_protocol_defs.h:87
time_t m_last_seen
Definition: net_peerlist.h:122
bool remove_from_peer_anchor(const epee::net_utils::network_address &addr)
Definition: net_peerlist.h:508
modify_all(const peerlist_entry &ple)
Definition: net_peerlist.h:105
modify_all_but_id(const peerlist_entry &ple)
Definition: net_peerlist.h:94
const peerlist_entry & m_ple
Definition: net_peerlist.h:111
void operator()(peerlist_entry &e)
Definition: net_peerlist.h:117
bool append_with_peer_gray(const peerlist_entry &pr)
Definition: net_peerlist.h:401
modify_last_seen(time_t last_seen)
Definition: net_peerlist.h:116
Definition: net_peerlist.h:88
Definition: net_peerlist.h:89
void operator()(peerlist_entry &e)
Definition: net_peerlist.h:106
boost::multi_index_container< anchor_peerlist_entry, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< by_addr >, boost::multi_index::member< anchor_peerlist_entry, epee::net_utils::network_address,&anchor_peerlist_entry::adr > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< by_time >, boost::multi_index::member< anchor_peerlist_entry, int64_t,&anchor_peerlist_entry::first_seen > > > > anchor_peers_indexed
Definition: net_peerlist.h:156
boost::multi_index_container< peerlist_entry, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< by_id >, boost::multi_index::member< peerlist_entry, uint64_t,&peerlist_entry::id > >, boost::multi_index::ordered_unique< boost::multi_index::tag< by_addr >, boost::multi_index::member< peerlist_entry, epee::net_utils::network_address,&peerlist_entry::adr > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< by_time >, boost::multi_index::member< peerlist_entry, int64_t,&peerlist_entry::last_seen > > > > peers_indexed_old
Definition: net_peerlist.h:146
bool get_white_peer_by_index(peerlist_entry &p, size_t i)
Definition: net_peerlist.h:281
BOOST_CLASS_VERSION(nodetool::node_server< cryptonote::t_cryptonote_protocol_handler< cryptonote::core > >, 1)
static __thread int depth
Definition: threadpool.cpp:38
#define P2P_DEFAULT_PEERS_IN_HANDSHAKE
Definition: cryptonote_config.h:108
peerid_type id
Definition: p2p_protocol_defs.h:73
time_t time
Definition: blockchain.cpp:90
bool deinit()
Definition: net_peerlist.h:229
void serialize_peers(Archive &a, List &list, Element ple, const t_version_type ver)
Definition: net_peerlist.h:160
size_t get_gray_peers_count()
Definition: net_peerlist.h:70
Definition: p2p_protocol_defs.h:85
bool remove_from_peer_gray(const peerlist_entry &pe)
Definition: net_peerlist.h:469
uint64_t peerid_type
Definition: p2p_protocol_defs.h:47
anchor_peers_indexed m_peers_anchor
Definition: net_peerlist.h:218
void operator()(peerlist_entry &e)
Definition: net_peerlist.h:95
Definition: net_peerlist.h:114
#define P2P_LOCAL_GRAY_PEERLIST_LIMIT
Definition: cryptonote_config.h:103
bool set_peer_unreachable(const peerlist_entry &pr)
Definition: net_peerlist.h:64
const peerlist_entry & m_ple
Definition: net_peerlist.h:100
bool is_host_allowed(const epee::net_utils::network_address &address)
Definition: net_peerlist.h:305
bool get_random_gray_peer(peerlist_entry &pe)
Definition: net_peerlist.h:448
void trim_white_peerlist()
Definition: net_peerlist.h:258
anchor_peerlist_entry_base< epee::net_utils::network_address > anchor_peerlist_entry
Definition: p2p_protocol_defs.h:97
std::string m_config_folder
Definition: net_peerlist.h:212
string a
Definition: MakeCryptoOps.py:15
bool append_with_peer_white(const peerlist_entry &pr)
Definition: net_peerlist.h:371
Definition: net_node.cpp:34
void trim_gray_peerlist()
Definition: net_peerlist.h:249
bool get_gray_peer_by_index(peerlist_entry &p, size_t i)
Definition: net_peerlist.h:293
Definition: net_peerlist.h:90
bool peers_indexed_from_old(const peers_indexed_old &pio, peers_indexed &pi)
Definition: net_peerlist.h:235
bool init(bool allow_local_ip)
Definition: net_peerlist.h:222
peers_indexed m_peers_white
Definition: net_peerlist.h:217
epee::critical_section m_peerlist_lock
Definition: net_peerlist.h:211
bool merge_peerlist(const std::list< peerlist_entry > &outer_bs)
Definition: net_peerlist.h:268
bool m_allow_local_ip
Definition: net_peerlist.h:213
boost::multi_index_container< peerlist_entry, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< by_addr >, boost::multi_index::member< peerlist_entry, epee::net_utils::network_address,&peerlist_entry::adr > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< by_time >, boost::multi_index::member< peerlist_entry, int64_t,&peerlist_entry::last_seen > > > > peers_indexed
Definition: net_peerlist.h:134
peers_indexed m_peers_gray
Definition: net_peerlist.h:216
#define P2P_LOCAL_WHITE_PEERLIST_LIMIT
Definition: cryptonote_config.h:102
Definition: p2p_protocol_defs.h:70
bool get_peerlist_full(std::list< peerlist_entry > &pl_gray, std::list< peerlist_entry > &pl_white)
Definition: net_peerlist.h:338
#define CURRENT_PEERLIST_STORAGE_ARCHIVE_VER
Definition: net_peerlist.h:55