types

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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
}

func (*PeerInfo) String added in v0.5.0

func (peerInfo *PeerInfo) String() string

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 *PeerList) DeletePPByNetworkAddress(networkAddress string)

func (*PeerList) GetPPByNetworkAddress added in v0.5.0

func (peerList *PeerList) GetPPByNetworkAddress(networkAddress string) *PeerInfo

func (*PeerList) GetPPByP2pAddress added in v0.5.0

func (peerList *PeerList) GetPPByP2pAddress(p2pAddress string) *PeerInfo

func (*PeerList) GetPPList added in v0.5.0

func (peerList *PeerList) GetPPList() []*PeerInfo

func (*PeerList) Init added in v0.5.0

func (peerList *PeerList) Init(localNetworkAddress, ppListPath string)

func (*PeerList) PPDisconnected added in v0.5.0

func (peerList *PeerList) PPDisconnected(p2pAddress, networkAddress string)

func (*PeerList) PPDisconnectedNetId added in v0.5.0

func (peerList *PeerList) PPDisconnectedNetId(netId int64)

func (*PeerList) SavePPList added in v0.5.0

func (peerList *PeerList) SavePPList(target *protos.RspGetPPList) error

func (*PeerList) UpdatePP added in v0.5.0

func (peerList *PeerList) UpdatePP(pp *PeerInfo)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL