Documentation ¶
Index ¶
- type Peer
- func (p *Peer) Address() string
- func (p *Peer) AdvertisedProtocolVersion() uint32
- func (p *Peer) Connection() *netadapter.NetConnection
- func (p *Peer) IBDRequestChannel() chan *external.DomainBlock
- func (p *Peer) ID() *id.ID
- func (p *Peer) IsOutbound() bool
- func (p *Peer) LastPingDuration() time.Duration
- func (p *Peer) ProtocolVersion() uint32
- func (p *Peer) SetPingIdle()
- func (p *Peer) SetPingPending(nonce uint64)
- func (p *Peer) String() string
- func (p *Peer) SubnetworkID() *external.DomainSubnetworkID
- func (p *Peer) TimeConnected() time.Duration
- func (p *Peer) TimeOffset() time.Duration
- func (p *Peer) UpdateFieldsFromMsgVersion(msg *appmessage.MsgVersion, maxProtocolVersion uint32)
- func (p *Peer) UserAgent() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer holds data about a peer.
func (*Peer) AdvertisedProtocolVersion ¶
AdvertisedProtocolVersion returns the peer's advertised protocol version.
func (*Peer) Connection ¶
func (p *Peer) Connection() *netadapter.NetConnection
Connection returns the NetConnection associated with this peer
func (*Peer) IBDRequestChannel ¶
func (p *Peer) IBDRequestChannel() chan *external.DomainBlock
IBDRequestChannel returns the channel used in order to communicate an IBD request between peer flows
func (*Peer) IsOutbound ¶
IsOutbound returns whether the peer is an outbound connection.
func (*Peer) LastPingDuration ¶
LastPingDuration returns the duration of the last ping to this peer
func (*Peer) ProtocolVersion ¶
ProtocolVersion returns the protocol version which is used when communicating with the peer.
func (*Peer) SetPingIdle ¶
func (p *Peer) SetPingIdle()
SetPingIdle sets the ping state of the peer to 'idle'
func (*Peer) SetPingPending ¶
SetPingPending sets the ping state of the peer to 'pending'
func (*Peer) SubnetworkID ¶
func (p *Peer) SubnetworkID() *external.DomainSubnetworkID
SubnetworkID returns the subnetwork the peer is associated with. It is nil in full nodes.
func (*Peer) TimeConnected ¶
TimeConnected returns the time since the connection to this been has been started.
func (*Peer) TimeOffset ¶
TimeOffset returns the peer's time offset.
func (*Peer) UpdateFieldsFromMsgVersion ¶
func (p *Peer) UpdateFieldsFromMsgVersion(msg *appmessage.MsgVersion, maxProtocolVersion uint32)
UpdateFieldsFromMsgVersion updates the peer with the data from the version message.