Use a single way to generate network map (#550)

This commit is contained in:
Maycon Santos
2022-11-08 11:38:40 +01:00
committed by GitHub
parent 7d7e576775
commit 157137e4ad
2 changed files with 11 additions and 37 deletions

View File

@@ -254,7 +254,6 @@ func (s *GRPCServer) registerPeer(peerKey wgtypes.Key, req *proto.LoginRequest)
}
// notify other peers of our registration
for _, remotePeer := range networkMap.Peers {
// todo update this once we have store v2 to avoid lock/peer
remotePeerNetworkMap, err := s.accountManager.GetNetworkMap(remotePeer.Key)
if err != nil {
return nil, status.Errorf(codes.Internal, "unable to fetch network map after registering peer, error: %v", err)
@@ -390,6 +389,9 @@ func ToResponseProto(configProto Protocol) proto.HostConfig_Protocol {
}
func toWiretrusteeConfig(config *Config, turnCredentials *TURNCredentials) *proto.WiretrusteeConfig {
if config == nil {
return nil
}
var stuns []*proto.HostConfig
for _, stun := range config.Stuns {
stuns = append(stuns, &proto.HostConfig{