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
2025-06-19 17:35:58 +08:00
committed by Olaoluwa Osuntokun
parent ceeb123925
commit da13c7ab66
3 changed files with 140 additions and 11 deletions

View File

@@ -4956,7 +4956,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.