From ce7bfae4f79b921f11dc443372a0f1f51ef3e2cf Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 9 Aug 2018 20:45:59 -0700 Subject: [PATCH] channeldb: ensure we always check error from fetchChanEdgePolicy --- channeldb/graph.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/channeldb/graph.go b/channeldb/graph.go index 22e7a1424..1867c6078 100644 --- a/channeldb/graph.go +++ b/channeldb/graph.go @@ -1843,6 +1843,9 @@ func (l *LightningNode) ForEachChannel(tx *bolt.Tx, outgoingPolicy, err := fetchChanEdgePolicy( edges, chanID, nodePub, nodes, ) + if err != nil { + return err + } otherNode, err := edgeInfo.OtherNodeKeyBytes(nodePub) if err != nil { @@ -1852,6 +1855,9 @@ func (l *LightningNode) ForEachChannel(tx *bolt.Tx, incomingPolicy, err := fetchChanEdgePolicy( edges, chanID, otherNode, nodes, ) + if err != nil { + return err + } // Finally, we execute the callback. err = cb(tx, &edgeInfo, outgoingPolicy, incomingPolicy)