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.
This commit is contained in:
Olaoluwa Osuntokun 2019-03-10 16:26:27 -07:00
parent b93ff26265
commit 19ef4bbcb9
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -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
}