mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
server: prevent increasing epochErrors if conn was established
In this commit, we fix a small bug where we would increase epochErrors by one even if connections were successfully established. Due to this, we would stay stuck inside of the peer bootstrapper loop without requerying for new peers.
This commit is contained in:
parent
8379bbaa9b
commit
0de0a39291
1 changed files with 7 additions and 0 deletions
|
@ -1346,6 +1346,10 @@ func (s *server) peerBootstrapper(numTargetPeers uint32,
|
|||
s.connectToPeer(a, errChan)
|
||||
select {
|
||||
case err := <-errChan:
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
|
||||
srvrLog.Errorf("Unable to "+
|
||||
"connect to %v: %v",
|
||||
a, err)
|
||||
|
@ -1413,6 +1417,9 @@ func (s *server) initialPeerBootstrap(ignore map[autopilot.NodeID]struct{},
|
|||
// us down.
|
||||
select {
|
||||
case err := <-errChan:
|
||||
if err == nil {
|
||||
return
|
||||
}
|
||||
srvrLog.Errorf("Unable to connect to "+
|
||||
"%v: %v", addr, err)
|
||||
// TODO: tune timeout? 3 seconds might be *too*
|
||||
|
|
Loading…
Add table
Reference in a new issue