BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
peer_connection.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #pragma once
25 
26 #include <graphene/net/node.hpp>
29 #include <graphene/net/config.hpp>
30 
31 #include <boost/tuple/tuple.hpp>
32 
33 #include <boost/multi_index_container.hpp>
34 #include <boost/multi_index/ordered_index.hpp>
35 #include <boost/multi_index/mem_fun.hpp>
36 #include <boost/multi_index/member.hpp>
37 #include <boost/multi_index/tag.hpp>
38 #include <boost/multi_index/hashed_index.hpp>
39 
40 #include <queue>
41 #include <boost/container/deque.hpp>
42 #include <fc/thread/future.hpp>
43 
44 namespace graphene { namespace net
45  {
46  class peer_connection;
48  {
49  public:
50  virtual ~peer_connection_delegate() = default;
51  virtual void on_message(peer_connection* originating_peer,
52  const message& received_message) = 0;
53  virtual void on_connection_closed(peer_connection* originating_peer) = 0;
54  virtual message get_message_for_item(const item_id& item) = 0;
55  };
56 
57  using peer_connection_ptr = std::shared_ptr<peer_connection>;
59  public std::enable_shared_from_this<peer_connection>
60  {
61  public:
63  {
70  };
72  {
77  };
79  {
81  connecting,
82  connected,
83  accepting,
84  accepted,
85  hello_sent,
89  closing,
90  closed
91  };
92  private:
94  fc::optional<fc::ip::endpoint> _remote_endpoint;
95  message_oriented_connection _message_connection;
96 
97  /* a base class for messages on the queue, to hide the fact that some
98  * messages are complete messages and some are only hashes of messages.
99  */
100  struct queued_message
101  {
102  fc::time_point enqueue_time;
103  fc::time_point transmission_start_time;
104  fc::time_point transmission_finish_time;
105 
106  explicit queued_message(fc::time_point enqueue_time = fc::time_point::now()) :
107  enqueue_time(enqueue_time)
108  {}
109 
110  virtual message get_message(peer_connection_delegate* node) = 0;
114  virtual size_t get_size_in_queue() = 0;
115  virtual ~queued_message() = default;
116  };
117 
118  /* when you queue up a 'real_queued_message', a full copy of the message is
119  * stored on the heap until it is sent
120  */
121  struct real_queued_message : queued_message
122  {
123  message message_to_send;
124  size_t message_send_time_field_offset;
125 
126  real_queued_message(message message_to_send,
127  size_t message_send_time_field_offset = (size_t)-1) :
128  message_to_send(std::move(message_to_send)),
129  message_send_time_field_offset(message_send_time_field_offset)
130  {}
131 
132  message get_message(peer_connection_delegate* node) override;
133  size_t get_size_in_queue() override;
134  };
135 
136  /* when you queue up a 'virtual_queued_message', we just queue up the hash of the
137  * item we want to send. When it reaches the top of the queue, we make a callback
138  * to the node to generate the message.
139  */
140  struct virtual_queued_message : queued_message
141  {
142  item_id item_to_send;
143 
144  explicit virtual_queued_message(item_id the_item_to_send) :
145  item_to_send(std::move(the_item_to_send))
146  {}
147 
148  message get_message(peer_connection_delegate* node) override;
149  size_t get_size_in_queue() override;
150  };
151 
152 
153  size_t _total_queued_messages_size = 0;
154  std::queue<std::unique_ptr<queued_message>, std::list<std::unique_ptr<queued_message> > > _queued_messages;
155  fc::future<void> _send_queued_messages_done;
156  public:
164 
169 
172 
173  fc::time_point get_connection_time()const { return _message_connection.get_connection_time(); }
175 
178 
185  uint32_t core_protocol_version = 0;
186  std::string user_agent;
193 
194  // Initially, these fields record info about our local socket,
195  // they are useless (except the remote_inbound_endpoint field for outbound connections).
196  // After we receive a hello message, they are replaced with the info in the hello message.
198  uint16_t inbound_port = 0;
199  uint16_t outbound_port = 0;
203  fc::flat_set<fc::ip::endpoint> additional_inbound_endpoints;
205  fc::flat_map<fc::ip::endpoint, firewalled_state> potential_inbound_endpoints;
207 
208  using item_to_time_map_type = std::unordered_map<item_id, fc::time_point>;
209 
213  boost::container::deque<item_hash_t> ids_of_items_to_get;
216  std::set<item_hash_t> ids_of_items_being_processed;
227  std::set<item_hash_t> sync_items_requested_from_peer;
233 
237  {
241  item(item),
243  {}
244  };
245  struct timestamp_index{};
246  using timestamped_items_set_type = boost::multi_index_container< timestamped_item_id,
247  boost::multi_index::indexed_by<
248  boost::multi_index::hashed_unique<
249  boost::multi_index::member<timestamped_item_id, item_id, &timestamped_item_id::item>,
250  std::hash<item_id>
251  >,
252  boost::multi_index::ordered_non_unique<
253  boost::multi_index::tag<timestamp_index>,
254  boost::multi_index::member<timestamped_item_id, fc::time_point_sec, &timestamped_item_id::timestamp>
255  >
256  >
257  >;
260 
265 
266  // if they're flooding us with transactions, we set this to avoid fetching for a few seconds to let the
267  // blockchain catch up
269 
271 
273 
276 
277  private:
278 #ifndef NDEBUG
279  fc::thread* _thread = nullptr;
280  unsigned _send_message_queue_tasks_running = 0; // temporary debugging
281 #endif
282  bool _currently_handling_message = false;
284  protected:
286  private:
287  void destroy();
288  public:
291  virtual ~peer_connection();
292 
294  void accept_connection();
295  void connect_to(const fc::ip::endpoint& remote_endpoint,
297 
298  void on_message(message_oriented_connection* originating_connection, const message& received_message) override;
299  void on_connection_closed(message_oriented_connection* originating_connection) override;
300 
301  void send_queueable_message(std::unique_ptr<queued_message>&& message_to_send);
302  virtual void send_message( const message& message_to_send, size_t message_send_time_field_offset = (size_t)-1 );
303  void send_item(const item_id& item_to_send);
304  void close_connection();
305  void destroy_connection();
306 
307  uint64_t get_total_bytes_sent() const;
308  uint64_t get_total_bytes_received() const;
309 
312 
315  void set_remote_endpoint(fc::optional<fc::ip::endpoint> new_remote_endpoint);
316 
317  bool busy() const;
318  bool idle() const;
319  bool is_currently_handling_message() const;
320 
323  void clear_old_inventory();
327  private:
328  void send_queued_messages_task();
329  void accept_connection_task();
330  void connect_to_task(const fc::ip::endpoint& remote_endpoint);
331  };
332  typedef std::shared_ptr<peer_connection> peer_connection_ptr;
333 
334  } } // end namespace graphene::net
335 
336 // not sent over the wire, just reflected for logging
338  (just_connected)
339  (connection_accepted)
340  (connection_rejected))
342  (just_connected)
343  (connection_accepted)
344  (connection_rejected))
346  (connecting)
347  (connected)
348  (accepting)
349  (accepted)
350  (hello_sent)
351  (peer_connection_accepted)
352  (peer_connection_rejected)
353  (negotiation_complete)
354  (closing)
355  (closed) )
356 
graphene::net::peer_connection::send_item
void send_item(const item_id &item_to_send)
Definition: peer_connection.cpp:422
graphene::net::peer_connection::inbound_address
fc::ip::address inbound_address
Definition: peer_connection.hpp:197
graphene::net::peer_connection::we_have_requested_close
bool we_have_requested_close
Definition: peer_connection.hpp:168
graphene::net::peer_connection::our_connection_state::disconnected
@ disconnected
graphene::net::peer_connection::connection_negotiation_status::hello_sent
@ hello_sent
graphene::net::peer_connection::their_state
their_connection_state their_state
Definition: peer_connection.hpp:167
graphene::net::peer_connection_delegate::on_message
virtual void on_message(peer_connection *originating_peer, const message &received_message)=0
graphene::net::peer_connection::timestamped_item_id
Definition: peer_connection.hpp:236
graphene::net::peer_connection::outbound_port
uint16_t outbound_port
Definition: peer_connection.hpp:199
graphene::net::peer_connection::negotiation_status
connection_negotiation_status negotiation_status
Definition: peer_connection.hpp:170
graphene::net::peer_connection::is_transaction_fetching_inhibited
bool is_transaction_fetching_inhibited() const
Definition: peer_connection.cpp:506
graphene::net::peer_connection::items_requested_from_peer
item_to_time_map_type items_requested_from_peer
Definition: peer_connection.hpp:263
graphene::net::peer_connection::get_last_message_received_time
fc::time_point get_last_message_received_time() const
Definition: peer_connection.cpp:465
graphene::net::peer_connection::connection_negotiation_status::peer_connection_rejected
@ peer_connection_rejected
graphene::net::peer_connection::number_of_unfetched_item_ids
uint32_t number_of_unfetched_item_ids
Number of items in the blockchain that follow ids_of_items_to_get but the peer hasn't yet told us the...
Definition: peer_connection.hpp:218
graphene::net::peer_connection::direction
peer_connection_direction direction
Definition: peer_connection.hpp:160
graphene::net::peer_connection::our_connection_state::connection_accepted
@ connection_accepted
graphene::net::peer_connection::connection_closed_time
fc::time_point connection_closed_time
Definition: peer_connection.hpp:158
graphene::net::peer_connection::on_connection_closed
void on_connection_closed(message_oriented_connection *originating_connection) override
Definition: peer_connection.cpp:317
graphene::net::firewalled_state::unknown
@ unknown
graphene::net::peer_connection::their_connection_state::connection_rejected
@ connection_rejected
We have sent them a connection_rejected.
graphene::net::peer_connection::connection_initiation_time
fc::time_point connection_initiation_time
Definition: peer_connection.hpp:157
graphene::net::peer_connection::get_total_bytes_sent
uint64_t get_total_bytes_sent() const
Definition: peer_connection.cpp:447
graphene::net::peer_connection::make_shared
static peer_connection_ptr make_shared(peer_connection_delegate *delegate)
Use this instead of the constructor.
Definition: peer_connection.cpp:98
graphene::net::peer_connection::~peer_connection
virtual ~peer_connection()
Definition: peer_connection.cpp:180
node.hpp
graphene::net::peer_connection::get_total_bytes_received
uint64_t get_total_bytes_received() const
Definition: peer_connection.cpp:453
graphene::net::message_oriented_connection_delegate
Definition: message_oriented_connection.hpp:35
graphene::net::peer_connection::connection_negotiation_status
connection_negotiation_status
Definition: peer_connection.hpp:78
fc::ip::address
Definition: ip.hpp:10
graphene::net::firewalled_state
firewalled_state
Definition: core_messages.hpp:271
graphene::net::peer_connection::is_inventory_advertised_to_us_list_full
bool is_inventory_advertised_to_us_list_full() const
Definition: peer_connection.cpp:547
graphene::net::peer_connection::our_state
our_connection_state our_state
Definition: peer_connection.hpp:165
graphene::net::peer_connection::peer_needs_sync_items_from_us
bool peer_needs_sync_items_from_us
Definition: peer_connection.hpp:219
graphene::net::message
Definition: message.hpp:58
graphene::net::peer_connection::sync_items_requested_from_peer
std::set< item_hash_t > sync_items_requested_from_peer
IDs of blocks we've requested from this peer during sync. Fetch from another peer if this peer discon...
Definition: peer_connection.hpp:227
graphene::net::peer_connection_delegate::~peer_connection_delegate
virtual ~peer_connection_delegate()=default
graphene::net::message_oriented_connection
Definition: message_oriented_connection.hpp:43
graphene::net::peer_connection::node_public_key
node_id_t node_public_key
Definition: peer_connection.hpp:179
graphene::net::peer_connection::clear_old_inventory
void clear_old_inventory()
Definition: peer_connection.cpp:518
graphene::net::peer_connection::connection_negotiation_status::accepting
@ accepting
graphene::net::peer_connection_delegate::get_message_for_item
virtual message get_message_for_item(const item_id &item)=0
fc::zero_initialized_array< unsigned char, 33 >
graphene::net::peer_connection::inhibit_fetching_sync_blocks
bool inhibit_fetching_sync_blocks
Definition: peer_connection.hpp:231
graphene::net::peer_connection::busy
bool busy() const
Definition: peer_connection.cpp:488
graphene::net::peer_connection::get_connection_terminated_time
fc::time_point get_connection_terminated_time() const
Definition: peer_connection.hpp:174
graphene::net::peer_connection::our_connection_state::connection_rejected
@ connection_rejected
graphene::net::peer_connection::connection_negotiation_status::connecting
@ connecting
graphene::net::peer_connection::connection_terminated_time
fc::time_point connection_terminated_time
Definition: peer_connection.hpp:159
fc::ip::endpoint
Definition: ip.hpp:65
graphene::net::peer_connection::get_shared_secret
fc::sha512 get_shared_secret() const
Definition: peer_connection.cpp:512
graphene::net::peer_connection::on_message
void on_message(message_oriented_connection *originating_connection, const message &received_message) override
Definition: peer_connection.cpp:306
graphene::net::peer_connection::send_queueable_message
void send_queueable_message(std::unique_ptr< queued_message > &&message_to_send)
Definition: peer_connection.cpp:380
graphene::net::peer_connection::connection_negotiation_status::closed
@ closed
fc::sha512
Definition: sha512.hpp:9
graphene::net::peer_connection::connection_negotiation_status::peer_connection_accepted
@ peer_connection_accepted
graphene::net::peer_connection::inventory_advertised_to_peer
timestamped_items_set_type inventory_advertised_to_peer
Definition: peer_connection.hpp:259
graphene::net::item_id
Definition: core_messages.hpp:49
graphene::net::peer_connection::last_sync_item_received_time
fc::time_point last_sync_item_received_time
Definition: peer_connection.hpp:225
graphene::net::peer_connection::send_message
virtual void send_message(const message &message_to_send, size_t message_send_time_field_offset=(size_t) -1)
Definition: peer_connection.cpp:412
graphene::net::peer_connection::get_endpoint_for_connecting
fc::optional< fc::ip::endpoint > get_endpoint_for_connecting() const
Definition: peer_connection.cpp:558
graphene::net::peer_connection_ptr
std::shared_ptr< peer_connection > peer_connection_ptr
Definition: peer_connection.hpp:57
graphene::net::peer_connection::accept_connection
void accept_connection()
Definition: peer_connection.cpp:192
graphene::net::peer_connection::our_connection_state
our_connection_state
Definition: peer_connection.hpp:62
graphene::net::peer_connection::set_remote_endpoint
void set_remote_endpoint(fc::optional< fc::ip::endpoint > new_remote_endpoint)
Definition: peer_connection.cpp:482
fc::thread
Definition: thread.hpp:39
graphene::net::peer_connection::get_connection_time
fc::time_point get_connection_time() const
Definition: peer_connection.hpp:173
fc::time_point_sec
Definition: time.hpp:74
graphene::net::peer_connection::connection_negotiation_status::negotiation_complete
@ negotiation_complete
graphene::net::peer_connection::get_remote_endpoint
fc::optional< fc::ip::endpoint > get_remote_endpoint()
Definition: peer_connection.cpp:471
graphene::net::peer_connection::last_known_fork_block_number
uint32_t last_known_fork_block_number
Definition: peer_connection.hpp:270
fc::ripemd160
Definition: ripemd160.hpp:11
graphene::net::peer_connection::get_local_endpoint
fc::ip::endpoint get_local_endpoint()
Definition: peer_connection.cpp:476
graphene::net::peer_connection::is_firewalled
firewalled_state is_firewalled
Definition: peer_connection.hpp:161
graphene::net::peer_connection::they_have_requested_close
bool they_have_requested_close
Definition: peer_connection.hpp:166
graphene::net::peer_connection::transaction_fetching_inhibited_until
fc::time_point transaction_fetching_inhibited_until
Definition: peer_connection.hpp:268
fc::tcp_socket
Definition: tcp_socket.hpp:14
graphene::net::peer_connection::platform
fc::optional< std::string > platform
Definition: peer_connection.hpp:191
graphene::net::peer_connection::connection_negotiation_status::closing
@ closing
graphene::net::peer_connection_direction
peer_connection_direction
Definition: core_messages.hpp:270
graphene::net::peer_connection::timestamped_item_id::item
item_id item
Definition: peer_connection.hpp:238
graphene::net::peer_connection::get_last_message_sent_time
fc::time_point get_last_message_sent_time() const
Definition: peer_connection.cpp:459
graphene::net::peer_connection::connection_closed_error
fc::oexception connection_closed_error
Definition: peer_connection.hpp:171
graphene::net::peer_connection::clock_offset
fc::microseconds clock_offset
Definition: peer_connection.hpp:162
graphene::net::peer_connection::close_connection
void close_connection()
Definition: peer_connection.cpp:431
graphene::net::peer_connection::peer_connection
peer_connection(peer_connection_delegate *delegate)
Definition: peer_connection.cpp:74
graphene::net::peer_connection::bitness
fc::optional< uint32_t > bitness
Definition: peer_connection.hpp:192
graphene::net::peer_connection::get_socket
fc::tcp_socket & get_socket()
Definition: peer_connection.cpp:186
graphene::net::peer_connection::is_currently_handling_message
bool is_currently_handling_message() const
Definition: peer_connection.cpp:500
fc::microseconds
Definition: time.hpp:12
graphene::net::peer_connection::node_id
node_id_t node_id
Definition: peer_connection.hpp:184
graphene::net::peer_connection::destroy_connection
void destroy_connection()
Definition: peer_connection.cpp:440
graphene::net::peer_connection::potential_inbound_endpoints
fc::flat_map< fc::ip::endpoint, firewalled_state > potential_inbound_endpoints
Potential inbound endpoints of the peer.
Definition: peer_connection.hpp:205
graphene::net::peer_connection::connection_negotiation_status::connected
@ connected
message_oriented_connection.hpp
graphene::net::peer_connection::additional_inbound_endpoints
fc::flat_set< fc::ip::endpoint > additional_inbound_endpoints
Some nodes may be listening on multiple endpoints.
Definition: peer_connection.hpp:203
fc::time_point::now
static time_point now()
Definition: time.cpp:13
graphene::net::peer_connection::timestamp_index
Definition: peer_connection.hpp:245
graphene::net::peer_connection::fc_git_revision_sha
fc::optional< std::string > fc_git_revision_sha
Definition: peer_connection.hpp:189
FC_REFLECT_ENUM
FC_REFLECT_ENUM(graphene::net::core_message_type_enum,(trx_message_type)(block_message_type)(core_message_type_first)(item_ids_inventory_message_type)(blockchain_item_ids_inventory_message_type)(fetch_blockchain_item_ids_message_type)(fetch_items_message_type)(item_not_available_message_type)(hello_message_type)(connection_accepted_message_type)(connection_rejected_message_type)(address_request_message_type)(address_message_type)(closing_connection_message_type)(current_time_request_message_type)(current_time_reply_message_type)(check_firewall_message_type)(check_firewall_reply_message_type)(get_current_connections_request_message_type)(get_current_connections_reply_message_type)(core_message_type_last))(different_chain)(already_connected)(connected_to_self)(not_accepting_connections)(blocked)(invalid_hello_message)(client_too_old))(inbound)(outbound))(firewalled)(not_firewalled))(unable_to_connect)(connection_successful)) namespace std
Definition: core_messages.hpp:404
graphene::net::peer_connection_delegate::on_connection_closed
virtual void on_connection_closed(peer_connection *originating_peer)=0
future.hpp
graphene::net::peer_connection::round_trip_delay
fc::microseconds round_trip_delay
Definition: peer_connection.hpp:163
fc::time_point
Definition: time.hpp:44
graphene::net::peer_connection::their_connection_state
their_connection_state
Definition: peer_connection.hpp:71
graphene::net::peer_connection::we_need_sync_items_from_peer
bool we_need_sync_items_from_peer
Definition: peer_connection.hpp:220
std
Definition: zeroed_array.hpp:76
graphene::net::peer_connection::expecting_address_message
bool expecting_address_message
Whether we're waiting for an address message.
Definition: peer_connection.hpp:275
graphene::net::peer_connection::connection_negotiation_status::disconnected
@ disconnected
graphene::net::peer_connection::item_ids_requested_from_peer
fc::optional< boost::tuple< std::vector< item_hash_t >, fc::time_point > > item_ids_requested_from_peer
We check this to detect a timed-out request and in busy()
Definition: peer_connection.hpp:222
graphene::net::peer_connection::graphene_git_revision_sha
fc::optional< std::string > graphene_git_revision_sha
Definition: peer_connection.hpp:187
graphene::net::peer_connection::their_connection_state::connection_accepted
@ connection_accepted
We have sent them a connection_accepted.
graphene::net::peer_connection::user_agent
std::string user_agent
Definition: peer_connection.hpp:186
graphene::net::peer_connection::graphene_git_revision_unix_timestamp
fc::optional< fc::time_point_sec > graphene_git_revision_unix_timestamp
Definition: peer_connection.hpp:188
graphene::net::peer_connection::connect_to
void connect_to(const fc::ip::endpoint &remote_endpoint, const fc::optional< fc::ip::endpoint > &local_endpoint=fc::optional< fc::ip::endpoint >())
Definition: peer_connection.cpp:230
graphene::net::peer_connection::ids_of_items_being_processed
std::set< item_hash_t > ids_of_items_being_processed
Definition: peer_connection.hpp:216
graphene::net::peer_connection::inbound_port
uint16_t inbound_port
Definition: peer_connection.hpp:198
graphene::net::peer_connection::remote_inbound_endpoint
fc::optional< fc::ip::endpoint > remote_inbound_endpoint
The inbound endpoint of the remote peer (our best guess)
Definition: peer_connection.hpp:201
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
graphene::net::peer_connection::core_protocol_version
uint32_t core_protocol_version
Definition: peer_connection.hpp:185
graphene::net::peer_connection::their_connection_state::just_connected
@ just_connected
We have not yet received a hello_message.
graphene::net::peer_connection_delegate
Definition: peer_connection.hpp:47
graphene::net::peer_connection::timestamped_items_set_type
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
Definition: peer_connection.hpp:257
graphene::net::peer_connection::timestamped_item_id::timestamped_item_id
timestamped_item_id(const item_id &item, const fc::time_point_sec timestamp)
Definition: peer_connection.hpp:240
fc::optional< fc::ip::endpoint >
graphene::net::peer_connection::fc_git_revision_unix_timestamp
fc::optional< fc::time_point_sec > fc_git_revision_unix_timestamp
Definition: peer_connection.hpp:190
graphene::net::peer_connection::is_inventory_advertised_to_us_list_full_for_transactions
bool is_inventory_advertised_to_us_list_full_for_transactions() const
Definition: peer_connection.cpp:541
graphene::net::peer_connection::last_block_time_delegate_has_seen
fc::time_point_sec last_block_time_delegate_has_seen
Definition: peer_connection.hpp:230
graphene::net::peer_connection::their_connection_state::disconnected
@ disconnected
graphene::net::peer_connection::our_connection_state::just_connected
@ just_connected
If in this state, we have sent a hello_message.
peer_database.hpp
graphene::net::peer_connection::timestamped_item_id::timestamp
fc::time_point_sec timestamp
Definition: peer_connection.hpp:239
config.hpp
graphene::net::peer_connection::idle
bool idle() const
Definition: peer_connection.cpp:494
graphene
Definition: api.cpp:48
fc::future< void >
Definition: future.hpp:283
graphene::net::peer_connection::connection_negotiation_status::accepted
@ accepted
graphene::net::peer_connection::accept_or_connect_task_done
fc::future< void > accept_or_connect_task_done
Definition: peer_connection.hpp:272
graphene::net::peer_connection::last_block_delegate_has_seen
item_hash_t last_block_delegate_has_seen
The hash of the last block this peer has told us about that the peer knows.
Definition: peer_connection.hpp:229
graphene::net::peer_connection_direction::unknown
@ unknown
graphene::net::peer_connection::ids_of_items_to_get
boost::container::deque< item_hash_t > ids_of_items_to_get
Definition: peer_connection.hpp:213
graphene::net::peer_connection::inventory_peer_advertised_to_us
timestamped_items_set_type inventory_peer_advertised_to_us
Definition: peer_connection.hpp:258
graphene::net::peer_connection
Definition: peer_connection.hpp:58
graphene::net::peer_connection::item_to_time_map_type
std::unordered_map< item_id, fc::time_point > item_to_time_map_type
Definition: peer_connection.hpp:208
graphene::net::message_oriented_connection::get_connection_time
fc::time_point get_connection_time() const
Definition: message_oriented_connection.cpp:444