pub struct LocalPeerView {Show 13 fields
pub(crate) message_times: Ema,
pub(crate) state: PeerStatus,
pub(crate) address_id: u32,
pub(crate) channel: UnboundedSender<NodeRequest>,
pub(crate) services: ServiceFlags,
pub(crate) user_agent: String,
pub(crate) address: IpAddr,
pub(crate) port: u16,
pub(crate) _last_message: Instant,
pub(crate) kind: ConnectionKind,
pub(crate) height: u32,
pub(crate) banscore: u32,
pub(crate) transport_protocol: TransportProtocol,
}Expand description
Local information kept about each peer
Fields§
§message_times: EmaAverage message times from this peer
This is measured in milliseconds, and it’s recorded every time we get a response from a peer
state: PeerStatusThe state in which this peer is, e.g., awaiting handshake, ready, banned, etc.
address_id: u32An id identifying this peer’s address in our address manager
channel: UnboundedSender<NodeRequest>A channel used to send requests to this peer
services: ServiceFlagsServices this peer claims to support
user_agent: StringA version string that identifies which software this peer is running
address: IpAddrThis peer’s IP address
port: u16The port we used to connect to this peer
_last_message: InstantThe last time we received a message from this peer
kind: ConnectionKindThe kind of connection we have with this peer
We use different connections with different goals, e.g., feeler connections, regular connections, extra connections to find about new tips, etc.
height: u32The latest height this peer has announced to us
banscore: u32The banscore of this peer
This is a score kept for each peer, every time this peer misbehaves, we increase this score. If the score reaches a certain threshold, we ban the peer.
transport_protocol: TransportProtocolThe transport protocol this peer is using (v1 or v2)
Implementations§
Source§impl LocalPeerView
impl LocalPeerView
Sourcepub(crate) const fn is_manual_peer(&self) -> bool
pub(crate) const fn is_manual_peer(&self) -> bool
Whether this is a manually added peer
Sourcepub(crate) const fn is_regular_peer(&self) -> bool
pub(crate) const fn is_regular_peer(&self) -> bool
Whether this is a regular peer
pub(crate) const fn is_long_lived(&self) -> bool
Trait Implementations§
Source§impl Clone for LocalPeerView
impl Clone for LocalPeerView
Source§fn clone(&self) -> LocalPeerView
fn clone(&self) -> LocalPeerView
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more