38 #include <boost/multi_index_container.hpp> 39 #include <boost/multi_index/member.hpp> 40 #include <boost/multi_index/ordered_index.hpp> 41 #include <boost/optional/optional.hpp> 47 namespace bootstrap_node
61 virtual boost::optional<node_info>
next_node() = 0;
67 selector_auto(std::function<std::map<std::string, bool>()> get_nodes,
size_t max_nodes = 1000)
73 boost::optional<node_info>
next_node() final;
92 typedef boost::multi_index_container<
94 boost::multi_index::indexed_by<
95 boost::multi_index::ordered_unique<boost::multi_index::tag<by_address>, boost::multi_index::member<node, std::string, &node::address>>,
96 boost::multi_index::ordered_non_unique<boost::multi_index::tag<by_fails>, boost::multi_index::member<node, size_t, &node::fails>>
Definition: bootstrap_node_selector.h:89
::std::string string
Definition: gtest-port.h:1097
void handle_result(const std::string &address, bool success) final
Definition: bootstrap_node_selector.cpp:51
size_t fails
Definition: bootstrap_node_selector.h:84
const size_t m_max_nodes
Definition: bootstrap_node_selector.h:101
const std::function< std::map< std::string, bool >)> m_get_nodes
Definition: bootstrap_node_selector.h:100
nodes_list m_nodes
Definition: bootstrap_node_selector.h:102
selector_auto(std::function< std::map< std::string, bool >()> get_nodes, size_t max_nodes=1000)
Definition: bootstrap_node_selector.h:67
bool has_at_least_one_good_node() const
Definition: bootstrap_node_selector.cpp:82
virtual void handle_result(const std::string &address, bool success)=0
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:44
virtual ~selector()=default
void append_new_nodes()
Definition: bootstrap_node_selector.cpp:87
std::string address
Definition: bootstrap_node_selector.h:83
boost::optional< epee::net_utils::http::login > credentials
Definition: bootstrap_node_selector.h:53
std::string address
Definition: bootstrap_node_selector.h:52
Definition: bootstrap_node_selector.h:81
bool success
Definition: cold-transaction.cpp:57
boost::optional< node_info > next_node() final
Definition: bootstrap_node_selector.cpp:63
Definition: bootstrap_node_selector.h:56
uint32_t address
Definition: getifaddr.c:269
const T & move(const T &t)
Definition: gtest-port.h:1317
Definition: bootstrap_node_selector.h:64
Definition: bootstrap_node_selector.h:50
virtual boost::optional< node_info > next_node()=0
Definition: bootstrap_node_selector.h:90
void truncate()
Definition: bootstrap_node_selector.cpp:105
#define const
Definition: ipfrdr.c:80
boost::multi_index_container< node, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< by_address >, boost::multi_index::member< node, std::string, &node::address > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< by_fails >, boost::multi_index::member< node, size_t, &node::fails > > > > nodes_list
Definition: bootstrap_node_selector.h:98