From 19ef4bbcb9bf8219f212f0ea49f1254616d69ec1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 10 Mar 2019 16:26:27 -0700 Subject: [PATCH] channeldb: within AddrsForNode don't fail if no graph node is found In this commit, we modify the `AddrsForNode` method to not fail if no graph node is found. We do this as when the backup is being restored/created, it's possible that we don't yet have a NodeAnnouncement for that node. --- channeldb/db.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/channeldb/db.go b/channeldb/db.go index 763a74c85..51a0eb1be 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -1018,7 +1018,9 @@ func (d *DB) AddrsForNode(nodePub *btcec.PublicKey) ([]net.Addr, error) { } compressedPubKey := nodePub.SerializeCompressed() graphNode, err = fetchLightningNode(nodes, compressedPubKey) - if err != nil { + if err != nil && err != ErrGraphNodeNotFound { + // If the node isn't found, then that's OK, as we still + // have the link node data. return err }