lnd: remove peer from peerChanInfo when necessary

We now remove the peer from `peerChanInfo` if this peer doesn't have
channels with us. Also patched a unit test for `removePeerAccess`.
This commit is contained in:
yyforyongyu committed 2025-06-19 20:23:46 +08:00
1 parent 32d8e2123d
commit 250a61af6d
3 files changed
+140 -11

No files matched your search

+2 -1
View File
@@ -4964,7 +4964,8 @@ func (s *server) removePeer(p *peer.Brontide) {
}
// Remove the peer's access permission from the access manager.
s.peerAccessMan.removePeerAccess(p.IdentityKey())
peerPubStr := string(p.IdentityKey().SerializeCompressed())
s.peerAccessMan.removePeerAccess(peerPubStr)
// Copy the peer's error buffer across to the server if it has any items
// in it so that we can restore peer errors across connections.