lnd: skip ErrEdgeNotFound when iterating channels
We now skip another error when iterating the channels for our persistent peers to unblock connecting to other peers.
This commit is contained in:
1 file changed
+12
-4
@@ -3547,8 +3547,9 @@ func (s *server) establishPersistentConnections() error {
|
|||||||
// the reconnection port to the default peer port.
|
// the reconnection port to the default peer port.
|
||||||
linkNodes, err := s.chanStateDB.LinkNodeDB().FetchAllLinkNodes()
|
linkNodes, err := s.chanStateDB.LinkNodeDB().FetchAllLinkNodes()
|
||||||
if err != nil && err != channeldb.ErrLinkNodesNotFound {
|
if err != nil && err != channeldb.ErrLinkNodesNotFound {
|
||||||
return err
|
return fmt.Errorf("failed to fetch all link nodes: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, node := range linkNodes {
|
for _, node := range linkNodes {
|
||||||
pubStr := string(node.IdentityPub.SerializeCompressed())
|
pubStr := string(node.IdentityPub.SerializeCompressed())
|
||||||
nodeAddrs := &nodeAddresses{
|
nodeAddrs := &nodeAddresses{
|
||||||
@@ -3563,7 +3564,7 @@ func (s *server) establishPersistentConnections() error {
|
|||||||
// that have been added via NodeAnnouncement messages.
|
// that have been added via NodeAnnouncement messages.
|
||||||
sourceNode, err := s.graphDB.SourceNode()
|
sourceNode, err := s.graphDB.SourceNode()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("failed to fetch source node: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): instead iterate over link nodes and query graph for
|
// TODO(roasbeef): instead iterate over link nodes and query graph for
|
||||||
@@ -3649,8 +3650,15 @@ func (s *server) establishPersistentConnections() error {
|
|||||||
nodeAddrsMap[pubStr] = n
|
nodeAddrsMap[pubStr] = n
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil && !errors.Is(err, graphdb.ErrGraphNoEdgesFound) {
|
if err != nil {
|
||||||
return err
|
srvrLog.Errorf("Failed to iterate channels for node %x",
|
||||||
|
sourceNode.PubKeyBytes)
|
||||||
|
|
||||||
|
if !errors.Is(err, graphdb.ErrGraphNoEdgesFound) &&
|
||||||
|
!errors.Is(err, graphdb.ErrEdgeNotFound) {
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
srvrLog.Debugf("Establishing %v persistent connections on start",
|
srvrLog.Debugf("Establishing %v persistent connections on start",
|
||||||
|
|||||||
Reference in new issue
Block a user