forked from naftalimurgor/go-bgld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
peer.go
51 lines (35 loc) · 1.14 KB
/
peer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package bgld
type Peer struct {
// The ip address and port of the peer
Addr string `json:"addr"`
// Local address
Addrlocal string `json:"addrlocal"`
// The services
Services string `json:"services"`
// The time in seconds since epoch (Jan 1 1970 GMT) of the last send
Lastsend uint64 `json:"lastsend"`
// The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
Lastrecv uint64 `json:"lastrecv"`
// The total bytes sent
Bytessent uint64 `json:"bytessent"`
// The total bytes received
Bytesrecv uint64 `json:"bytesrecv"`
// The connection time in seconds since epoch (Jan 1 1970 GMT)
Conntime uint64 `json:"conntime"`
// Ping time
Pingtime float64 `json:"pingtime"`
// Ping Wait
Pingwait float64 `json:"pingwait"`
// The peer version, such as 7001
Version uint32 `json:"version"`
// The string version
Subver string `json:"subver"`
// Inbound (true) or Outbound (false)
Inbound bool `json:"inbound"`
// The starting height (block) of the peer
Startingheight int32 `json:"startingheight"`
// The ban score (stats.nMisbehavior)
Banscore int32 `json:"banscore"`
// If sync node
Syncnode bool `json:"syncnode"`
}