Skip to content

Commit

Permalink
Check if channel exist before sending network map (#1894)
Browse files Browse the repository at this point in the history
Check for connection channel before calculating and sending the network map
  • Loading branch information
mlsmaycon authored Apr 29, 2024
1 parent 4424162 commit fd26e98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions management/server/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,10 @@ func (am *DefaultAccountManager) updateAccountPeers(account *Account) {
return
}
for _, peer := range peers {
if !am.peersUpdateManager.HasChannel(peer.ID) {
log.Tracef("peer %s doesn't have a channel, skipping network map update", peer.ID)
continue
}
remotePeerNetworkMap := account.GetPeerNetworkMap(peer.ID, am.dnsDomain, approvedPeersMap)
update := toSyncResponse(nil, peer, nil, remotePeerNetworkMap, am.GetDNSDomain())
am.peersUpdateManager.SendUpdate(peer.ID, &UpdateMessage{Update: update})
Expand Down

0 comments on commit fd26e98

Please sign in to comment.