BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
#include <peer_connection.hpp>
Classes | |
struct | timestamp_index |
struct | timestamped_item_id |
Static Public Member Functions | |
static peer_connection_ptr | make_shared (peer_connection_delegate *delegate) |
Use this instead of the constructor. More... | |
Protected Member Functions | |
peer_connection (peer_connection_delegate *delegate) | |
using | 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, ×tamped_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, ×tamped_item_id::timestamp > > > > |
timestamped_items_set_type | inventory_peer_advertised_to_us |
timestamped_items_set_type | inventory_advertised_to_peer |
item_to_time_map_type | items_requested_from_peer |
Definition at line 58 of file peer_connection.hpp.
using graphene::net::peer_connection::item_to_time_map_type = std::unordered_map<item_id, fc::time_point> |
Definition at line 208 of file peer_connection.hpp.
using 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, ×tamped_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, ×tamped_item_id::timestamp> > > > |
Definition at line 257 of file peer_connection.hpp.
Enumerator | |
---|---|
disconnected | |
connecting | |
connected | |
accepting | |
accepted | |
hello_sent | |
peer_connection_accepted | |
peer_connection_rejected | |
negotiation_complete | |
closing | |
closed |
Definition at line 78 of file peer_connection.hpp.
Enumerator | |
---|---|
disconnected | |
just_connected | If in this state, we have sent a hello_message. |
connection_accepted | Remote side has sent us a connection_accepted, we're operating normally with them |
connection_rejected | Remote side has sent us a connection_rejected, we may be exchanging address with them or may just be waiting for them to close |
Definition at line 62 of file peer_connection.hpp.
Enumerator | |
---|---|
disconnected | |
just_connected | We have not yet received a hello_message. |
connection_accepted | We have sent them a connection_accepted. |
connection_rejected | We have sent them a connection_rejected. |
Definition at line 71 of file peer_connection.hpp.
|
protected |
Definition at line 74 of file peer_connection.cpp.
|
virtual |
Definition at line 180 of file peer_connection.cpp.
void graphene::net::peer_connection::accept_connection | ( | ) |
Definition at line 192 of file peer_connection.cpp.
bool graphene::net::peer_connection::busy | ( | ) | const |
Definition at line 488 of file peer_connection.cpp.
void graphene::net::peer_connection::clear_old_inventory | ( | ) |
Definition at line 518 of file peer_connection.cpp.
void graphene::net::peer_connection::close_connection | ( | ) |
Definition at line 431 of file peer_connection.cpp.
void graphene::net::peer_connection::connect_to | ( | const fc::ip::endpoint & | remote_endpoint, |
const fc::optional< fc::ip::endpoint > & | local_endpoint = fc::optional<fc::ip::endpoint>() |
||
) |
Definition at line 230 of file peer_connection.cpp.
void graphene::net::peer_connection::destroy_connection | ( | ) |
Definition at line 440 of file peer_connection.cpp.
|
inline |
Definition at line 174 of file peer_connection.hpp.
|
inline |
Definition at line 173 of file peer_connection.hpp.
fc::optional< fc::ip::endpoint > graphene::net::peer_connection::get_endpoint_for_connecting | ( | ) | const |
Definition at line 558 of file peer_connection.cpp.
fc::time_point graphene::net::peer_connection::get_last_message_received_time | ( | ) | const |
Definition at line 465 of file peer_connection.cpp.
fc::time_point graphene::net::peer_connection::get_last_message_sent_time | ( | ) | const |
Definition at line 459 of file peer_connection.cpp.
fc::ip::endpoint graphene::net::peer_connection::get_local_endpoint | ( | ) |
Definition at line 476 of file peer_connection.cpp.
fc::optional< fc::ip::endpoint > graphene::net::peer_connection::get_remote_endpoint | ( | ) |
Definition at line 471 of file peer_connection.cpp.
fc::sha512 graphene::net::peer_connection::get_shared_secret | ( | ) | const |
Definition at line 512 of file peer_connection.cpp.
fc::tcp_socket & graphene::net::peer_connection::get_socket | ( | ) |
Definition at line 186 of file peer_connection.cpp.
uint64_t graphene::net::peer_connection::get_total_bytes_received | ( | ) | const |
Definition at line 453 of file peer_connection.cpp.
uint64_t graphene::net::peer_connection::get_total_bytes_sent | ( | ) | const |
Definition at line 447 of file peer_connection.cpp.
bool graphene::net::peer_connection::idle | ( | ) | const |
Definition at line 494 of file peer_connection.cpp.
bool graphene::net::peer_connection::is_currently_handling_message | ( | ) | const |
Definition at line 500 of file peer_connection.cpp.
bool graphene::net::peer_connection::is_inventory_advertised_to_us_list_full | ( | ) | const |
Definition at line 547 of file peer_connection.cpp.
bool graphene::net::peer_connection::is_inventory_advertised_to_us_list_full_for_transactions | ( | ) | const |
Definition at line 541 of file peer_connection.cpp.
bool graphene::net::peer_connection::is_transaction_fetching_inhibited | ( | ) | const |
Definition at line 506 of file peer_connection.cpp.
|
static |
Use this instead of the constructor.
Definition at line 98 of file peer_connection.cpp.
|
overridevirtual |
Implements graphene::net::message_oriented_connection_delegate.
Definition at line 317 of file peer_connection.cpp.
|
overridevirtual |
Implements graphene::net::message_oriented_connection_delegate.
Definition at line 306 of file peer_connection.cpp.
void graphene::net::peer_connection::send_item | ( | const item_id & | item_to_send | ) |
Definition at line 422 of file peer_connection.cpp.
|
virtual |
Definition at line 412 of file peer_connection.cpp.
void graphene::net::peer_connection::send_queueable_message | ( | std::unique_ptr< queued_message > && | message_to_send | ) |
Definition at line 380 of file peer_connection.cpp.
void graphene::net::peer_connection::set_remote_endpoint | ( | fc::optional< fc::ip::endpoint > | new_remote_endpoint | ) |
Definition at line 482 of file peer_connection.cpp.
fc::future<void> graphene::net::peer_connection::accept_or_connect_task_done |
Definition at line 272 of file peer_connection.hpp.
fc::flat_set<fc::ip::endpoint> graphene::net::peer_connection::additional_inbound_endpoints |
Some nodes may be listening on multiple endpoints.
Definition at line 203 of file peer_connection.hpp.
fc::optional<uint32_t> graphene::net::peer_connection::bitness |
Definition at line 192 of file peer_connection.hpp.
fc::microseconds graphene::net::peer_connection::clock_offset |
Definition at line 162 of file peer_connection.hpp.
fc::oexception graphene::net::peer_connection::connection_closed_error |
Definition at line 171 of file peer_connection.hpp.
fc::time_point graphene::net::peer_connection::connection_closed_time |
Definition at line 158 of file peer_connection.hpp.
fc::time_point graphene::net::peer_connection::connection_initiation_time |
Definition at line 157 of file peer_connection.hpp.
fc::time_point graphene::net::peer_connection::connection_terminated_time |
Definition at line 159 of file peer_connection.hpp.
uint32_t graphene::net::peer_connection::core_protocol_version = 0 |
Definition at line 185 of file peer_connection.hpp.
peer_connection_direction graphene::net::peer_connection::direction = peer_connection_direction::unknown |
Definition at line 160 of file peer_connection.hpp.
bool graphene::net::peer_connection::expecting_address_message = false |
Whether we're waiting for an address message.
Definition at line 275 of file peer_connection.hpp.
fc::optional<std::string> graphene::net::peer_connection::fc_git_revision_sha |
Definition at line 189 of file peer_connection.hpp.
fc::optional<fc::time_point_sec> graphene::net::peer_connection::fc_git_revision_unix_timestamp |
Definition at line 190 of file peer_connection.hpp.
fc::optional<std::string> graphene::net::peer_connection::graphene_git_revision_sha |
Definition at line 187 of file peer_connection.hpp.
fc::optional<fc::time_point_sec> graphene::net::peer_connection::graphene_git_revision_unix_timestamp |
Definition at line 188 of file peer_connection.hpp.
std::set<item_hash_t> graphene::net::peer_connection::ids_of_items_being_processed |
List of all items this peer has offered use that we've already handed to the client but the client hasn't finished processing
Definition at line 216 of file peer_connection.hpp.
boost::container::deque<item_hash_t> graphene::net::peer_connection::ids_of_items_to_get |
Blockchain synchronization state data
ID of items in the blockchain that this peer has told us about
Definition at line 213 of file peer_connection.hpp.
fc::ip::address graphene::net::peer_connection::inbound_address |
Definition at line 197 of file peer_connection.hpp.
uint16_t graphene::net::peer_connection::inbound_port = 0 |
Definition at line 198 of file peer_connection.hpp.
bool graphene::net::peer_connection::inhibit_fetching_sync_blocks = false |
Definition at line 231 of file peer_connection.hpp.
timestamped_items_set_type graphene::net::peer_connection::inventory_advertised_to_peer |
Definition at line 259 of file peer_connection.hpp.
timestamped_items_set_type graphene::net::peer_connection::inventory_peer_advertised_to_us |
Definition at line 258 of file peer_connection.hpp.
firewalled_state graphene::net::peer_connection::is_firewalled = firewalled_state::unknown |
Definition at line 161 of file peer_connection.hpp.
fc::optional<boost::tuple<std::vector<item_hash_t>, fc::time_point> > graphene::net::peer_connection::item_ids_requested_from_peer |
We check this to detect a timed-out request and in busy()
Definition at line 222 of file peer_connection.hpp.
item_to_time_map_type graphene::net::peer_connection::items_requested_from_peer |
Items we've requested from this peer during normal operation. Fetch from another peer if this peer disconnects
Definition at line 263 of file peer_connection.hpp.
item_hash_t graphene::net::peer_connection::last_block_delegate_has_seen |
The hash of the last block this peer has told us about that the peer knows.
Definition at line 229 of file peer_connection.hpp.
fc::time_point_sec graphene::net::peer_connection::last_block_time_delegate_has_seen |
Definition at line 230 of file peer_connection.hpp.
uint32_t graphene::net::peer_connection::last_known_fork_block_number = 0 |
Definition at line 270 of file peer_connection.hpp.
fc::time_point graphene::net::peer_connection::last_sync_item_received_time |
The time we received the last sync item or the time we sent the last batch of sync item requests to this peer
Definition at line 225 of file peer_connection.hpp.
connection_negotiation_status graphene::net::peer_connection::negotiation_status = connection_negotiation_status::disconnected |
Definition at line 170 of file peer_connection.hpp.
node_id_t graphene::net::peer_connection::node_id |
the unique identifier we'll use to refer to the node with. zero-initialized before we receive the hello message, at which time it will be filled with either the "node_id" from the user_data field of the hello, or if none is present it will be filled with a copy of node_public_key
Definition at line 184 of file peer_connection.hpp.
node_id_t graphene::net::peer_connection::node_public_key |
data about the peer node node_public_key from the hello message, zero-initialized before we get the hello
Definition at line 179 of file peer_connection.hpp.
uint32_t graphene::net::peer_connection::number_of_unfetched_item_ids = 0 |
Number of items in the blockchain that follow ids_of_items_to_get but the peer hasn't yet told us their IDs.
Definition at line 218 of file peer_connection.hpp.
our_connection_state graphene::net::peer_connection::our_state = our_connection_state::disconnected |
Definition at line 165 of file peer_connection.hpp.
uint16_t graphene::net::peer_connection::outbound_port = 0 |
Definition at line 199 of file peer_connection.hpp.
bool graphene::net::peer_connection::peer_needs_sync_items_from_us = false |
Definition at line 219 of file peer_connection.hpp.
fc::optional<std::string> graphene::net::peer_connection::platform |
Definition at line 191 of file peer_connection.hpp.
fc::flat_map<fc::ip::endpoint, firewalled_state> graphene::net::peer_connection::potential_inbound_endpoints |
Potential inbound endpoints of the peer.
Definition at line 205 of file peer_connection.hpp.
fc::optional<fc::ip::endpoint> graphene::net::peer_connection::remote_inbound_endpoint |
The inbound endpoint of the remote peer (our best guess)
Definition at line 201 of file peer_connection.hpp.
fc::microseconds graphene::net::peer_connection::round_trip_delay |
Definition at line 163 of file peer_connection.hpp.
std::set<item_hash_t> graphene::net::peer_connection::sync_items_requested_from_peer |
IDs of blocks we've requested from this peer during sync. Fetch from another peer if this peer disconnects.
Definition at line 227 of file peer_connection.hpp.
their_connection_state graphene::net::peer_connection::their_state = their_connection_state::disconnected |
Definition at line 167 of file peer_connection.hpp.
bool graphene::net::peer_connection::they_have_requested_close = false |
Definition at line 166 of file peer_connection.hpp.
fc::time_point graphene::net::peer_connection::transaction_fetching_inhibited_until |
Definition at line 268 of file peer_connection.hpp.
std::string graphene::net::peer_connection::user_agent |
Definition at line 186 of file peer_connection.hpp.
bool graphene::net::peer_connection::we_have_requested_close = false |
Definition at line 168 of file peer_connection.hpp.
bool graphene::net::peer_connection::we_need_sync_items_from_peer = false |
Definition at line 220 of file peer_connection.hpp.