channeldb: ensure we always check error from fetchChanEdgePolicy

This commit is contained in:
Olaoluwa Osuntokun 2018-08-09 20:45:59 -07:00
parent 0109672835
commit ce7bfae4f7
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

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