37 #include <boost/multi_index_container.hpp> 38 #include <boost/multi_index/member.hpp> 39 #include <boost/multi_index/ordered_index.hpp> 40 #include <boost/optional/optional.hpp> 42 #include "net/http_client.h" 46 namespace bootstrap_node
60 virtual boost::optional<node_info>
next_node() = 0;
66 selector_auto(std::function<std::map<std::string, bool>()> get_nodes,
size_t max_nodes = 1000)
72 boost::optional<node_info>
next_node() final;
91 typedef boost::multi_index_container<
93 boost::multi_index::indexed_by<
94 boost::multi_index::ordered_unique<boost::multi_index::tag<by_address>, boost::multi_index::member<node, std::string, &node::address>>,
95 boost::multi_index::ordered_non_unique<boost::multi_index::tag<by_fails>, boost::multi_index::member<node, size_t, &node::fails>>
99 const std::function<std::map<std::string, bool>()>
m_get_nodes;
Definition: bootstrap_node_selector.h:88
void handle_result(const std::string &address, bool success) final
Definition: bootstrap_node_selector.cpp:50
Definition: blockchain_ancestry.cpp:71
size_t fails
Definition: bootstrap_node_selector.h:83
const size_t m_max_nodes
Definition: bootstrap_node_selector.h:100
const
Definition: build_protob.py:9
const std::function< std::map< std::string, bool >)> m_get_nodes
Definition: bootstrap_node_selector.h:99
nodes_list m_nodes
Definition: bootstrap_node_selector.h:101
selector_auto(std::function< std::map< std::string, bool >()> get_nodes, size_t max_nodes=1000)
Definition: bootstrap_node_selector.h:66
bool has_at_least_one_good_node() const
Definition: bootstrap_node_selector.cpp:81
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:86
std::string address
Definition: bootstrap_node_selector.h:82
boost::optional< epee::net_utils::http::login > credentials
Definition: bootstrap_node_selector.h:52
std::string address
Definition: bootstrap_node_selector.h:51
Definition: bootstrap_node_selector.h:80
boost::optional< node_info > next_node() final
Definition: bootstrap_node_selector.cpp:62
Definition: bootstrap_node_selector.h:55
expect< void > success() noexcept
Definition: expect.h:397
Definition: bootstrap_node_selector.h:63
Definition: bootstrap_node_selector.h:49
virtual boost::optional< node_info > next_node()=0
Definition: bootstrap_node_selector.h:89
void truncate()
Definition: bootstrap_node_selector.cpp:104
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:97