Add Sequence field #13 to packet header according to latest Whitepaper 0.7.1

The field is yet to be used.
This commit is contained in:
Kleissner
2021-04-18 05:22:19 +02:00
parent a82f575816
commit 703e40c947
4 changed files with 46 additions and 23 deletions

View File

@@ -45,6 +45,16 @@ func (c *Connection) IsLocal() bool {
return IsIPLocal(c.Address.IP)
}
// IsIPv4 checks if the connection is using IPv4
func (c *Connection) IsIPv4() bool {
return IsIPv4(c.Address.IP)
}
// IsIPv6 checks if the connection is using IPv6
func (c *Connection) IsIPv6() bool {
return IsIPv6(c.Address.IP)
}
// GetConnections returns the list of connections
func (peer *PeerInfo) GetConnections(active bool) (connections []*Connection) {
peer.RLock()