mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-03 17:40:02 +01:00
server: exit early if not persistent peer
The point of this commit is to make future commits in the same PR easier to review. All that this commit does is exit early if the peer we are considering is not persistent instead of having a bunch of logic indented in an if-clause.
This commit is contained in:
@@ -3517,8 +3517,10 @@ func (s *server) peerTerminationWatcher(p *peer.Brontide, ready chan struct{}) {
|
||||
s.removePeer(p)
|
||||
|
||||
// Next, check to see if this is a persistent peer or not.
|
||||
_, ok := s.persistentPeers[pubStr]
|
||||
if ok {
|
||||
if _, ok := s.persistentPeers[pubStr]; !ok {
|
||||
return
|
||||
}
|
||||
|
||||
// We'll only need to re-launch a connection request if one
|
||||
// isn't already currently pending.
|
||||
if _, ok := s.persistentConnReqs[pubStr]; ok {
|
||||
@@ -3606,7 +3608,6 @@ func (s *server) peerTerminationWatcher(p *peer.Brontide, ready chan struct{}) {
|
||||
s.connMgr.Connect(connReq)
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// removePeer removes the passed peer from the server's state of all active
|
||||
// peers.
|
||||
|
||||
Reference in New Issue
Block a user