channeldb: ensure we always check error from fetchChanEdgePolicy

This commit is contained in:
Olaoluwa Osuntokun committed 2018-08-09 20:46:04 -07:00
1 parent 0109672835
commit ce7bfae4f7
1 file changed
+6
+6
View File
@@ -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)