Documentation ¶
Index ¶
- Constants
- type PeerInfo
- type PeerList
- func (peerList *PeerList) DeletePPByNetworkAddress(networkAddress string)
- func (peerList *PeerList) GetPPByNetworkAddress(networkAddress string) *PeerInfo
- func (peerList *PeerList) GetPPByP2pAddress(p2pAddress string) *PeerInfo
- func (peerList *PeerList) GetPPList() []*PeerInfo
- func (peerList *PeerList) Init(localNetworkAddress, ppListPath string)
- func (peerList *PeerList) PPDisconnected(p2pAddress, networkAddress string)
- func (peerList *PeerList) PPDisconnectedNetId(netId int64)
- func (peerList *PeerList) SavePPList(target *protos.RspGetPPList) error
- func (peerList *PeerList) UpdatePP(pp *PeerInfo)
Constants ¶
View Source
const ( PEER_NOT_CONNECTED = iota PEER_CONNECTED PEER_UNREACHABLE // Unreachable peers will not be stored to the pp list file )
View Source
const ( PP_INACTIVE = iota PP_ACTIVE = 1 PP_UNBONDING = 2 PP_SUSPENDED = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerInfo ¶ added in v0.5.0
type PeerInfo struct { NetworkAddress string P2pAddress string RestAddress string WalletAddress string DiscoveryTime int64 // When was this peer discovered for the first time LastConnectionTime int64 // When was the last time we connected with this peer NetId int64 // The ID of the current connection with this node, if it exists. Status int }
type PeerList ¶ added in v0.5.0
type PeerList struct {
// contains filtered or unexported fields
}
func (*PeerList) DeletePPByNetworkAddress ¶ added in v0.5.0
func (*PeerList) GetPPByNetworkAddress ¶ added in v0.5.0
func (*PeerList) GetPPByP2pAddress ¶ added in v0.5.0
func (*PeerList) PPDisconnected ¶ added in v0.5.0
func (*PeerList) PPDisconnectedNetId ¶ added in v0.5.0
func (*PeerList) SavePPList ¶ added in v0.5.0
func (peerList *PeerList) SavePPList(target *protos.RspGetPPList) error
Click to show internal directories.
Click to hide internal directories.