server: cleanup persistentPeerAddr when pruned

Delete all the stored addresses from the persistentPeerAddr map when we
prune the persistent peer.
This commit is contained in:
Elle Mouton committed 2021-11-04 13:05:40 +02:00
1 parent a6f22c6185
commit 789f00746b
1 file changed
+1
+1
View File
@@ -2858,6 +2858,7 @@ func (s *server) prunePersistentPeerConnection(compressedPubKey [33]byte) {
if perm, ok := s.persistentPeers[pubKeyStr]; ok && !perm {
delete(s.persistentPeers, pubKeyStr)
delete(s.persistentPeersBackoff, pubKeyStr)
delete(s.persistentPeerAddrs, pubKeyStr)
s.cancelConnReqs(pubKeyStr, nil)
s.mu.Unlock()