NET-528: add host static info to peer update (#2550)

* set isstatic field on peer update

* remove static check for peer port
This commit is contained in:
Abhishek K 2023-08-31 00:33:37 +05:30 committed by GitHub
parent a7fce5c3ba
commit 31fcc8cd6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -181,6 +181,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
Interfaces: peerHost.Interfaces,
ListenPort: peerPort,
IsStatic: peerHost.IsStatic,
}
nodePeer = peerConfig
} else {
@ -191,6 +192,7 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
hostPeerUpdate.HostNetworkInfo[peerHost.PublicKey.String()] = models.HostNetworkInfo{
Interfaces: peerHost.Interfaces,
ListenPort: peerPort,
IsStatic: peerHost.IsStatic,
}
nodePeer = hostPeerUpdate.Peers[peerIndexMap[peerHost.PublicKey.String()]]
}

View file

@ -44,6 +44,7 @@ type HostInfoMap map[string]HostNetworkInfo
type HostNetworkInfo struct {
Interfaces []Iface `json:"interfaces" yaml:"interfaces"`
ListenPort int `json:"listen_port" yaml:"listen_port"`
IsStatic bool `json:"is_static"`
}
// PeerMap - peer map for ids and addresses in metrics