Check if channel exist before sending network map (#1894)

Check for connection channel before calculating and sending the network map
This commit is contained in:
Maycon Santos 2024-04-29 18:31:52 +02:00 committed by GitHub
parent 4424162bce
commit fd26e989e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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})