channeldb: check fetchOpenChannel() error

This commit is contained in:
ueno committed 2021-11-23 17:31:57 +09:00
1 parent fd22aab52e
commit 86425091e9
2 files changed
+7 -2

No files matched your search

+4 -1
View File
@@ -1410,9 +1410,12 @@ func (c *ChannelStateDB) FetchHistoricalChannel(outPoint *wire.OutPoint) (
}
channel, err = fetchOpenChannel(chanBucket, outPoint)
if err != nil {
return err
}
channel.Db = c
return err
return nil
}, func() {
channel = nil
})