add ext peers field to host update

This commit is contained in:
Abhishek Kondur 2023-01-31 09:27:36 +04:00
parent e670cb04a1
commit f2d8cf4fb6
2 changed files with 2 additions and 0 deletions

View file

@ -412,6 +412,7 @@ func GetPeerUpdateForHost(host *models.Host) (models.HostPeerUpdate, error) {
extPeers, extPeerIDAndAddrs, err := getExtPeers(&node)
if err == nil {
hostPeerUpdate.Peers = append(hostPeerUpdate.Peers, extPeers...)
hostPeerUpdate.ExtPeers = extPeers
for _, extPeerIdAndAddr := range extPeerIDAndAddrs {
hostPeerUpdate.PeerIDs[extPeerIdAndAddr.ID] = make(map[string]models.IDandAddr)
hostPeerUpdate.PeerIDs[extPeerIdAndAddr.ID][extPeerIdAndAddr.ID] = models.IDandAddr{

View file

@ -25,6 +25,7 @@ type HostPeerUpdate struct {
Peers []wgtypes.PeerConfig `json:"peers" bson:"peers" yaml:"peers"`
PeerIDs HostPeerMap `json:"peerids" bson:"peerids" yaml:"peerids"`
ProxyUpdate proxy_models.ProxyManagerPayload `json:"proxy_update" bson:"proxy_update" yaml:"proxy_update"`
ExtPeers []wgtypes.PeerConfig `json:"ext_peers" bson:"ext_peers" yaml:"ext_peers"`
}
// NetworkInfo - struct for network info