BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface software
node_impl.hxx
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 #include <fc/thread/thread.hpp>
4 #include <fc/log/logger.hpp>
8 #include <graphene/net/node.hpp>
11 
12 namespace graphene { namespace net { namespace detail {
13 
14 // when requesting items from peers, we want to prioritize any blocks before
15 // transactions, but otherwise request items in the order we heard about them
17 {
19  unsigned sequence_number;
20  fc::time_point timestamp; // the time we last heard about this item in an inventory message
21 
22  prioritized_item_id(const item_id& item, unsigned sequence_number) :
23  item(item),
24  sequence_number(sequence_number),
25  timestamp(fc::time_point::now())
26  {}
27  bool operator<(const prioritized_item_id& rhs) const
28  {
30  "block_message_type must be greater than trx_message_type for prioritized_item_ids to sort correctly");
31  if (item.item_type != rhs.item.item_type)
32  return item.item_type > rhs.item.item_type;
33  return (signed)(rhs.sequence_number - sequence_number) > 0;
34  }
35 };
36 
38 {
39 private:
40  node_delegate *_node_delegate;
41  fc::thread *_thread;
42 
43  typedef boost::accumulators::accumulator_set<int64_t, boost::accumulators::stats<boost::accumulators::tag::min,
44  boost::accumulators::tag::rolling_mean,
45  boost::accumulators::tag::max,
46  boost::accumulators::tag::sum,
47  boost::accumulators::tag::count> > call_stats_accumulator;
48 #define NODE_DELEGATE_METHOD_NAMES (has_item) \
49  (handle_message) \
50  (handle_block) \
51  (handle_transaction) \
52  (get_block_ids) \
53  (get_item) \
54  (get_chain_id) \
55  (get_blockchain_synopsis) \
56  (sync_status) \
57  (connection_count_changed) \
58  (get_block_number) \
59  (get_block_time) \
60  (get_head_block_id) \
61  (estimate_last_known_fork_from_git_revision_timestamp) \
62  (error_encountered) \
63  (get_current_block_interval_in_seconds)
64 
65 
66 
67 #define DECLARE_ACCUMULATOR(r, data, method_name) \
68  mutable call_stats_accumulator BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator)); \
69  mutable call_stats_accumulator BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator)); \
70  mutable call_stats_accumulator BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator));
71  BOOST_PP_SEQ_FOR_EACH(DECLARE_ACCUMULATOR, unused, NODE_DELEGATE_METHOD_NAMES)
72 #undef DECLARE_ACCUMULATOR
73 
74  class call_statistics_collector
75  {
76  private:
77  fc::time_point _call_requested_time;
78  fc::time_point _begin_execution_time;
79  fc::time_point _execution_completed_time;
80  const char* _method_name;
81  call_stats_accumulator* _execution_accumulator;
82  call_stats_accumulator* _delay_before_accumulator;
83  call_stats_accumulator* _delay_after_accumulator;
84  public:
86  {
87  std::shared_ptr<call_statistics_collector> _collector;
88  public:
89  actual_execution_measurement_helper(std::shared_ptr<call_statistics_collector> collector) :
90  _collector(collector)
91  {
92  _collector->starting_execution();
93  }
95  {
96  _collector->execution_completed();
97  }
98  };
99  call_statistics_collector(const char* method_name,
100  call_stats_accumulator* execution_accumulator,
101  call_stats_accumulator* delay_before_accumulator,
102  call_stats_accumulator* delay_after_accumulator) :
103  _call_requested_time(fc::time_point::now()),
104  _method_name(method_name),
105  _execution_accumulator(execution_accumulator),
106  _delay_before_accumulator(delay_before_accumulator),
107  _delay_after_accumulator(delay_after_accumulator)
108  {}
109  ~call_statistics_collector()
110  {
112  fc::microseconds actual_execution_time(_execution_completed_time - _begin_execution_time);
113  fc::microseconds delay_before(_begin_execution_time - _call_requested_time);
114  fc::microseconds delay_after(end_time - _execution_completed_time);
115  fc::microseconds total_duration(actual_execution_time + delay_before + delay_after);
116  (*_execution_accumulator)(actual_execution_time.count());
117  (*_delay_before_accumulator)(delay_before.count());
118  (*_delay_after_accumulator)(delay_after.count());
119  if (total_duration > fc::milliseconds(500))
120  {
121  ilog("Call to method node_delegate::${method} took ${total_duration}us, longer than our target maximum of 500ms",
122  ("method", _method_name)
123  ("total_duration", total_duration.count()));
124  ilog("Actual execution took ${execution_duration}us, with a ${delegate_delay}us delay before the delegate thread started "
125  "executing the method, and a ${p2p_delay}us delay after it finished before the p2p thread started processing the response",
126  ("execution_duration", actual_execution_time)
127  ("delegate_delay", delay_before)
128  ("p2p_delay", delay_after));
129  }
130  }
131  void starting_execution()
132  {
133  _begin_execution_time = fc::time_point::now();
134  }
135  void execution_completed()
136  {
137  _execution_completed_time = fc::time_point::now();
138  }
139  };
140  public:
141  statistics_gathering_node_delegate_wrapper(node_delegate* delegate, fc::thread* thread_for_delegate_calls);
142 
143  fc::variant_object get_call_statistics();
144 
145  bool has_item( const graphene::net::item_id& id ) override;
146  void handle_message( const message& ) override;
147  bool handle_block( const graphene::net::block_message& block_message, bool sync_mode, std::vector<fc::uint160_t>& contained_transaction_message_ids ) override;
148  void handle_transaction( const graphene::net::trx_message& transaction_message ) override;
149  std::vector<item_hash_t> get_block_ids(const std::vector<item_hash_t>& blockchain_synopsis,
150  uint32_t& remaining_item_count,
151  uint32_t limit = 2000) override;
152  message get_item( const item_id& id ) override;
153  graphene::protocol::chain_id_type get_chain_id() const override;
154  std::vector<item_hash_t> get_blockchain_synopsis(const item_hash_t& reference_point,
155  uint32_t number_of_blocks_after_reference_point) override;
156  void sync_status( uint32_t item_type, uint32_t item_count ) override;
157  void connection_count_changed( uint32_t c ) override;
158  uint32_t get_block_number(const item_hash_t& block_id) override;
159  fc::time_point_sec get_block_time(const item_hash_t& block_id) override;
160  item_hash_t get_head_block_id() const override;
161  uint32_t estimate_last_known_fork_from_git_revision_timestamp(uint32_t unix_timestamp) const override;
162  void error_encountered(const std::string& message, const fc::oexception& error) override;
163  uint8_t get_current_block_interval_in_seconds() const override;
164  };
165 
167 {
168  public:
169 #ifdef P2P_IN_DEDICATED_THREAD
170  std::shared_ptr<fc::thread> _thread;
171 #endif // P2P_IN_DEDICATED_THREAD
172  std::unique_ptr<statistics_gathering_node_delegate_wrapper> _delegate;
174 
175 #define NODE_CONFIGURATION_FILENAME "node_config.json"
176 #define POTENTIAL_PEER_DATABASE_FILENAME "peers.json"
179 
181  // _node_configuration.listen_endpoint, unless that endpoint was already
182  // in use.
184 
190 
192  // @{
193  std::list<potential_peer_record> _add_once_node_list;
194 
199  // @}
200 
202  // @{
206 
207  typedef std::unordered_map<graphene::net::block_id_type, fc::time_point> active_sync_requests_map;
208 
209  active_sync_requests_map _active_sync_requests;
210  std::list<graphene::net::block_message> _new_received_sync_items;
211  std::list<graphene::net::block_message> _received_sync_items;
212  // @}
213 
216 
218  // @{
222 
223  struct item_id_index{};
224  typedef boost::multi_index_container<prioritized_item_id,
225  boost::multi_index::indexed_by<boost::multi_index::ordered_unique<boost::multi_index::identity<prioritized_item_id> >,
226  boost::multi_index::hashed_unique<boost::multi_index::tag<item_id_index>,
227  boost::multi_index::member<prioritized_item_id, item_id, &prioritized_item_id::item>,
228  std::hash<item_id> > >
233  // @}
234 
236  // @{
239  std::unordered_set<item_id> _new_inventory;
240  // @}
241 
243  uint8_t _recent_block_interval_in_seconds; // a cached copy of the block interval, to avoid a thread hop to the blockchain to get the current value
244 
245  std::string _user_agent_string;
260 
269 
272 
275  std::unordered_set<graphene::net::peer_connection_ptr> _handshaking_connections;
277  std::unordered_set<graphene::net::peer_connection_ptr> _active_connections;
279  std::unordered_set<graphene::net::peer_connection_ptr> _closing_connections;
281  std::unordered_set<graphene::net::peer_connection_ptr> _terminating_connections;
282 
283  boost::circular_buffer<item_hash_t> _most_recent_blocks_accepted; // the /n/ most recent blocks we've accepted (currently tuned to the max number of connections)
284 
285  uint32_t _sync_item_type;
287  std::vector<uint32_t> _hard_fork_block_numbers;
288 
290 
292 
293  uint32_t _last_reported_number_of_connections; // number of connections last reported to the client (to avoid sending duplicate messages)
294 
296 
298 
299  boost::circular_buffer<uint32_t> _average_network_read_speed_seconds;
300  boost::circular_buffer<uint32_t> _average_network_write_speed_seconds;
301  boost::circular_buffer<uint32_t> _average_network_read_speed_minutes;
302  boost::circular_buffer<uint32_t> _average_network_write_speed_minutes;
303  boost::circular_buffer<uint32_t> _average_network_read_speed_hours;
304  boost::circular_buffer<uint32_t> _average_network_write_speed_hours;
307 
310 
312 
313  /* We have two alternate paths through the schedule_peer_for_deletion code -- one that
314  * uses a mutex to prevent one fiber from adding items to the queue while another is deleting
315  * items from it, and one that doesn't. The one that doesn't is simpler and more efficient
316  * code, but we're keeping around the version that uses the mutex because it crashes, and
317  * this crash probably indicates a bug in our underlying threading code that needs
318  * fixing. To produce the bug, define USE_PEERS_TO_DELETE_MUTEX and then connect up
319  * to the network and set your desired/max connection counts high
320  */
321 //#define USE_PEERS_TO_DELETE_MUTEX 1
322 #ifdef USE_PEERS_TO_DELETE_MUTEX
323  fc::mutex _peers_to_delete_mutex;
324 #endif
325  std::list<peer_connection_ptr> _peers_to_delete;
327 
328 #ifdef ENABLE_P2P_DEBUGGING_API
329  std::set<node_id_t> _allowed_peers;
330 #endif // ENABLE_P2P_DEBUGGING_API
331 
332  bool _node_is_shutting_down; // set to true when we begin our destructor, used to prevent us from starting new tasks while we're shutting down
333 
337 
338  std::list<fc::future<void> > _handle_message_calls_in_progress;
339 
341  // @{
342  boost::container::flat_set<std::string> _seed_nodes;
344  void update_seed_nodes_task();
345  void schedule_next_update_seed_nodes_task();
346  // @}
347 
348  node_impl(const std::string& user_agent);
349  virtual ~node_impl();
350 
351  void save_node_configuration();
352 
353  void p2p_network_connect_loop();
354  void trigger_p2p_network_connect_loop();
355 
356  bool have_already_received_sync_item( const item_hash_t& item_hash );
357  void request_sync_item_from_peer( const peer_connection_ptr& peer, const item_hash_t& item_to_request );
358  void request_sync_items_from_peer( const peer_connection_ptr& peer, const std::vector<item_hash_t>& items_to_request );
359  void fetch_sync_items_loop();
360  void trigger_fetch_sync_items_loop();
361 
362  bool is_item_in_any_peers_inventory(const item_id& item) const;
363  void fetch_items_loop();
364  void trigger_fetch_items_loop();
365 
366  void advertise_inventory_loop();
367  void trigger_advertise_inventory_loop();
368 
369  void terminate_inactive_connections_loop();
370 
371  void fetch_updated_peer_lists_loop();
372  void update_bandwidth_data(uint32_t bytes_read_this_second, uint32_t bytes_written_this_second);
373  void bandwidth_monitor_loop();
374  void dump_node_status_task();
375 
376  bool is_accepting_new_connections();
377  bool is_wanting_new_connections();
378  uint32_t get_number_of_connections();
379  peer_connection_ptr get_peer_by_node_id(const node_id_t& id);
380 
381  bool is_already_connected_to_id(const node_id_t& node_id);
382  bool merge_address_info_with_potential_peer_database( const std::vector<address_info> addresses );
383  void display_current_connections();
384  uint32_t calculate_unsynced_block_count_from_all_peers();
385  std::vector<item_hash_t> create_blockchain_synopsis_for_peer( const peer_connection* peer );
386  void fetch_next_batch_of_item_ids_from_peer( peer_connection* peer, bool reset_fork_tracking_data_for_peer = false );
387 
388  fc::variant_object generate_hello_user_data();
389  void parse_hello_user_data_for_peer( peer_connection* originating_peer, const fc::variant_object& user_data );
390 
391  void on_message( peer_connection* originating_peer,
392  const message& received_message ) override;
393 
394  void on_hello_message( peer_connection* originating_peer,
395  const hello_message& hello_message_received );
396 
397  void on_connection_accepted_message( peer_connection* originating_peer,
398  const connection_accepted_message& connection_accepted_message_received );
399 
400  void on_connection_rejected_message( peer_connection* originating_peer,
401  const connection_rejected_message& connection_rejected_message_received );
402 
403  void on_address_request_message( peer_connection* originating_peer,
404  const address_request_message& address_request_message_received );
405 
406  void on_address_message( peer_connection* originating_peer,
407  const address_message& address_message_received );
408 
409  void on_fetch_blockchain_item_ids_message( peer_connection* originating_peer,
410  const fetch_blockchain_item_ids_message& fetch_blockchain_item_ids_message_received );
411 
412  void on_blockchain_item_ids_inventory_message( peer_connection* originating_peer,
413  const blockchain_item_ids_inventory_message& blockchain_item_ids_inventory_message_received );
414 
415  void on_fetch_items_message( peer_connection* originating_peer,
416  const fetch_items_message& fetch_items_message_received );
417 
418  void on_item_not_available_message( peer_connection* originating_peer,
419  const item_not_available_message& item_not_available_message_received );
420 
421  void on_item_ids_inventory_message( peer_connection* originating_peer,
422  const item_ids_inventory_message& item_ids_inventory_message_received );
423 
424  void on_closing_connection_message( peer_connection* originating_peer,
425  const closing_connection_message& closing_connection_message_received );
426 
427  void on_current_time_request_message( peer_connection* originating_peer,
428  const current_time_request_message& current_time_request_message_received );
429 
430  void on_current_time_reply_message( peer_connection* originating_peer,
431  const current_time_reply_message& current_time_reply_message_received );
432 
433  void forward_firewall_check_to_next_available_peer(firewall_check_state_data* firewall_check_state);
434 
435  void on_check_firewall_message(peer_connection* originating_peer,
436  const check_firewall_message& check_firewall_message_received);
437 
438  void on_check_firewall_reply_message(peer_connection* originating_peer,
439  const check_firewall_reply_message& check_firewall_reply_message_received);
440 
441  void on_get_current_connections_request_message(peer_connection* originating_peer,
442  const get_current_connections_request_message& get_current_connections_request_message_received);
443 
444  void on_get_current_connections_reply_message(peer_connection* originating_peer,
445  const get_current_connections_reply_message& get_current_connections_reply_message_received);
446 
447  void on_connection_closed(peer_connection* originating_peer) override;
448 
449  void send_sync_block_to_node_delegate(const graphene::net::block_message& block_message_to_send);
450  void process_backlog_of_sync_blocks();
451  void trigger_process_backlog_of_sync_blocks();
452  void process_block_during_sync(peer_connection* originating_peer, const graphene::net::block_message& block_message, const message_hash_type& message_hash);
453  void process_block_during_normal_operation(peer_connection* originating_peer, const graphene::net::block_message& block_message, const message_hash_type& message_hash);
454  void process_block_message(peer_connection* originating_peer, const message& message_to_process, const message_hash_type& message_hash);
455 
456  void process_ordinary_message(peer_connection* originating_peer, const message& message_to_process, const message_hash_type& message_hash);
457 
458  void start_synchronizing();
459  void start_synchronizing_with_peer(const peer_connection_ptr& peer);
460 
461  void new_peer_just_added(const peer_connection_ptr& peer);
462 
463  void close();
464 
465  void accept_connection_task(peer_connection_ptr new_peer);
466  void accept_loop();
467  void send_hello_message(const peer_connection_ptr& peer);
468  void connect_to_task(peer_connection_ptr new_peer, const fc::ip::endpoint& remote_endpoint);
469  bool is_connection_to_endpoint_in_progress(const fc::ip::endpoint& remote_endpoint);
470 
471  void move_peer_to_active_list(const peer_connection_ptr& peer);
472  void move_peer_to_closing_list(const peer_connection_ptr& peer);
473  void move_peer_to_terminating_list(const peer_connection_ptr& peer);
474 
475  peer_connection_ptr get_connection_to_endpoint( const fc::ip::endpoint& remote_endpoint );
476 
477  void dump_node_status();
478 
479  void delayed_peer_deletion_task();
480  void schedule_peer_for_deletion(const peer_connection_ptr& peer_to_delete);
481 
482  void disconnect_from_peer( peer_connection* originating_peer,
483  const std::string& reason_for_disconnect,
484  bool caused_by_error = false,
485  const fc::oexception& additional_data = fc::oexception() );
486 
487  // methods implementing node's public interface
488  void set_node_delegate(node_delegate* del, fc::thread* thread_for_delegate_calls);
489  void load_configuration( const fc::path& configuration_directory );
490  void listen_to_p2p_network();
491  void connect_to_p2p_network();
492  void add_node( const fc::ip::endpoint& ep );
493  void add_seed_node( const std::string& seed_string );
494  void resolve_seed_node_and_add( const std::string& seed_string );
495  void initiate_connect_to(const peer_connection_ptr& peer);
496  void connect_to_endpoint(const fc::ip::endpoint& ep);
497  void listen_on_endpoint(const fc::ip::endpoint& ep , bool wait_if_not_available);
498  void accept_incoming_connections(bool accept);
499  void listen_on_port( uint16_t port, bool wait_if_not_available );
500 
501  fc::ip::endpoint get_actual_listening_endpoint() const;
502  std::vector<peer_status> get_connected_peers() const;
503  uint32_t get_connection_count() const;
504 
505  void broadcast(const message& item_to_broadcast, const message_propagation_data& propagation_data);
506  void broadcast(const message& item_to_broadcast);
507  void sync_from(const item_id& current_head_block, const std::vector<uint32_t>& hard_fork_block_numbers);
508  bool is_connected() const;
509  std::vector<potential_peer_record> get_potential_peers() const;
510  void set_advanced_node_parameters( const fc::variant_object& params );
511 
512  fc::variant_object get_advanced_node_parameters();
513  message_propagation_data get_transaction_propagation_data( const graphene::net::transaction_id_type& transaction_id );
514  message_propagation_data get_block_propagation_data( const graphene::net::block_id_type& block_id );
515 
516  node_id_t get_node_id() const;
517  void set_allowed_peers( const std::vector<node_id_t>& allowed_peers );
518  void clear_peer_database();
519  void set_total_bandwidth_limit( uint32_t upload_bytes_per_second, uint32_t download_bytes_per_second );
520  void disable_peer_advertising();
521  fc::variant_object get_call_statistics() const;
522  message get_message_for_item(const item_id& item) override;
523 
524  fc::variant_object network_get_info() const;
525  fc::variant_object network_get_usage_stats() const;
526 
527  bool is_hard_fork_block(uint32_t block_number) const;
528  uint32_t get_next_known_hard_fork_block_number(uint32_t block_number) const;
529  }; // end class node_impl
530 
531 }}} // end of namespace graphene::net::detail
#define DECLARE_ACCUMULATOR(r, data, method_name)
Definition: node_impl.hxx:67
unsigned _maximum_number_of_blocks_to_handle_at_one_time
Definition: node_impl.hxx:334
std::unordered_set< graphene::net::peer_connection_ptr > _active_connections
Definition: node_impl.hxx:277
fc::promise< void >::ptr _retrigger_fetch_sync_items_loop_promise
used by the task that fetches sync items during synchronization
Definition: node_impl.hxx:203
fc::time_point _last_firewall_check_message_sent
Definition: node_impl.hxx:189
boost::circular_buffer< uint32_t > _average_network_read_speed_seconds
Definition: node_impl.hxx:299
std::list< potential_peer_record > _add_once_node_list
used by the task that manages connecting to peers
Definition: node_impl.hxx:193
fc::future< void > _fetch_updated_peer_lists_loop_done
Definition: node_impl.hxx:297
std::unordered_set< item_id > _new_inventory
Definition: node_impl.hxx:239
node_configuration _node_configuration
Definition: node_impl.hxx:178
fc::ip::endpoint _actual_listening_endpoint
stores the endpoint we&#39;re listening on. This will be the same as
Definition: node_impl.hxx:183
fc::future< void > _dump_node_status_task_done
Definition: node_impl.hxx:311
boost::circular_buffer< uint32_t > _average_network_read_speed_minutes
Definition: node_impl.hxx:301
An order-perserving dictionary of variant&#39;s.
Definition: api.cpp:56
fc::future< void > _update_seed_nodes_loop_done
Definition: node_impl.hxx:343
microseconds milliseconds(int64_t s)
Definition: time.hpp:35
std::unordered_set< graphene::net::peer_connection_ptr > _terminating_connections
Definition: node_impl.hxx:281
#define NODE_DELEGATE_METHOD_NAMES
Definition: node_impl.hxx:48
fc::future< void > _process_backlog_of_sync_blocks_done
list of sync blocks we&#39;ve received, but can&#39;t yet process because we are still missing blocks that co...
Definition: node_impl.hxx:214
used by node reports status to client or fetch data from client
Definition: node.hpp:61
fc::future< void > _p2p_network_connect_loop_done
Definition: node_impl.hxx:198
active_sync_requests_map _active_sync_requests
Definition: node_impl.hxx:209
fc::future< void > _advertise_inventory_loop_done
Definition: node_impl.hxx:238
fc::future< void > _bandwidth_monitor_loop_done
Definition: node_impl.hxx:309
items_to_fetch_set_type _items_to_fetch
Definition: node_impl.hxx:231
boost::circular_buffer< uint32_t > _average_network_write_speed_hours
Definition: node_impl.hxx:304
fc::rate_limiting_group _rate_limiter
cache message we have received and might be required to provide to other peers via inventory requests...
Definition: node_impl.hxx:291
fc::ripemd160 block_id_type
Definition: types.hpp:242
void accept(AcceptorType &acc, SocketType &sock)
wraps boost::asio::async_accept
Definition: asio.hpp:251
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
boost::circular_buffer< uint32_t > _average_network_read_speed_hours
Definition: node_impl.hxx:303
boost::container::flat_set< std::string > _seed_nodes
used by the task that checks whether addresses of seed nodes have been updated
Definition: node_impl.hxx:342
mutex
Definition: mutex.hpp:91
fc::future< void > _fetch_sync_items_loop_done
Definition: node_impl.hxx:205
std::list< graphene::net::block_message > _new_received_sync_items
list of sync blocks we&#39;ve asked for from peers but have not yet received
Definition: node_impl.hxx:210
prioritized_item_id(const item_id &item, unsigned sequence_number)
Definition: node_impl.hxx:22
boost::circular_buffer< uint32_t > _average_network_write_speed_seconds
Definition: node_impl.hxx:300
fc::optional< fc::ip::endpoint > _publicly_visible_listening_endpoint
if we&#39;re behind NAT, our listening endpoint address will appear different to the rest of the world...
Definition: node_impl.hxx:188
int64_t count() const
Definition: time.hpp:28
#define ilog(FORMAT,...)
Definition: logger.hpp:117
fc::future< void > _terminate_inactive_connections_loop_done
list of items we have received but not yet advertised to our peers
Definition: node_impl.hxx:242
fc::future< void > _accept_loop_complete
Definition: node_impl.hxx:271
fc::future< void > _delayed_peer_deletion_task_done
Definition: node_impl.hxx:326
firewalled_state _is_firewalled
we determine whether we&#39;re firewalled by asking other nodes. Store the result here: ...
Definition: node_impl.hxx:186
boost::multi_index_container< prioritized_item_id, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::identity< prioritized_item_id > >, boost::multi_index::hashed_unique< boost::multi_index::tag< item_id_index >, boost::multi_index::member< prioritized_item_id, item_id,&prioritized_item_id::item >, std::hash< item_id > > > > items_to_fetch_set_type
Definition: node_impl.hxx:229
std::vector< uint32_t > _hard_fork_block_numbers
the number of items we still need to fetch while syncing
Definition: node_impl.hxx:287
std::shared_ptr< peer_connection > peer_connection_ptr
fc::promise< void >::ptr _retrigger_fetch_item_loop_promise
used by the task that fetches items during normal operation
Definition: node_impl.hxx:219
std::unordered_set< graphene::net::peer_connection_ptr > _handshaking_connections
Definition: node_impl.hxx:275
bool operator<(const prioritized_item_id &rhs) const
Definition: node_impl.hxx:27
fc::future< void > _fetch_item_loop_done
Definition: node_impl.hxx:221
Definition: api.hpp:15
fc::promise< void >::ptr _retrigger_advertise_inventory_loop_promise
list of transactions we&#39;ve recently pushed and had rejected by the delegate
Definition: node_impl.hxx:237
boost::circular_buffer< uint32_t > _average_network_write_speed_minutes
Definition: node_impl.hxx:302
std::unordered_set< graphene::net::peer_connection_ptr > _closing_connections
Definition: node_impl.hxx:279
static time_point now()
Definition: time.cpp:13
std::list< fc::future< void > > _handle_message_calls_in_progress
Definition: node_impl.hxx:338
boost::multi_index_container< timestamped_item_id, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::member< timestamped_item_id, item_id,&timestamped_item_id::item >, std::hash< item_id > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< timestamp_index >, boost::multi_index::member< timestamped_item_id, fc::time_point_sec,&timestamped_item_id::timestamp > > > > timestamped_items_set_type
fc::ripemd160 transaction_id_type
Definition: types.hpp:244
unsigned _maximum_number_of_sync_blocks_to_prefetch
Definition: node_impl.hxx:335
wraps boost::filesystem::path to provide platform independent path manipulation.
Definition: filesystem.hpp:28
peer_connection::timestamped_items_set_type _recently_failed_items
list of items we know another peer has and we want
Definition: node_impl.hxx:232
std::list< graphene::net::block_message > _received_sync_items
list of sync blocks we&#39;ve just received but haven&#39;t yet tried to process
Definition: node_impl.hxx:211
fc::promise< void >::ptr _retrigger_connect_loop_promise
Definition: node_impl.hxx:196
std::list< peer_connection_ptr > _peers_to_delete
Definition: node_impl.hxx:325
unsigned _maximum_blocks_per_peer_during_syncing
Definition: node_impl.hxx:336
std::unique_ptr< statistics_gathering_node_delegate_wrapper > _delegate
Definition: node_impl.hxx:172
fc::time_point_sec _bandwidth_monitor_last_update_time
Definition: node_impl.hxx:308
boost::circular_buffer< item_hash_t > _most_recent_blocks_accepted
Definition: node_impl.hxx:283
std::unordered_map< graphene::net::block_id_type, fc::time_point > active_sync_requests_map
Definition: node_impl.hxx:207
peer_database _potential_peer_db
list of peers we want to connect to as soon as possible
Definition: node_impl.hxx:195
blockchain_tied_message_cache _message_cache
list of all block numbers where there are hard forks
Definition: node_impl.hxx:289