Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
OnAccept: s.InboundPeerConnected,
RetryDuration: time.Second * 5,
TargetOutbound: 100,
GetNewAddress: nil,
Dial: noiseDial(s.identityPriv),
OnConnection: s.OutboundPeerConnected,
})
Expand Down Expand Up @@ -1087,6 +1086,12 @@ func (s *server) peerTerminationWatcher(p *peer) {
pubStr := string(p.addr.IdentityKey.SerializeCompressed())
_, ok := s.persistentPeers[pubStr]
if ok {
// We'll only need to re-launch a connection request if one
// isn't already currently pending.
if _, ok := s.persistentConnReqs[pubStr]; ok {
return
}

srvrLog.Debugf("Attempting to re-establish persistent "+
"connection to peer %v", p)

Expand All @@ -1098,12 +1103,6 @@ func (s *server) peerTerminationWatcher(p *peer) {
Permanent: true,
}

// We'll only need to re-launch a connection requests if one
// isn't already currently pending.
if _, ok := s.persistentConnReqs[pubStr]; ok {
return
}

// Otherwise, we'll launch a new connection requests in order
// to attempt to maintain a persistent connection with this
// peer.
Expand Down