From 86425091e9bb0af22d466b69d1e1863f3dcb532a Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 23 Nov 2021 09:36:42 +0900 Subject: [PATCH] channeldb: check fetchOpenChannel() error --- channeldb/db.go | 5 ++++- docs/release-notes/release-notes-0.14.1.md | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/channeldb/db.go b/channeldb/db.go index 173aada2d..1b56d3de3 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -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 }) diff --git a/docs/release-notes/release-notes-0.14.1.md b/docs/release-notes/release-notes-0.14.1.md index d02038749..76a5274ca 100644 --- a/docs/release-notes/release-notes-0.14.1.md +++ b/docs/release-notes/release-notes-0.14.1.md @@ -3,7 +3,9 @@ ## Bug Fixes * [Fixed an inaccurate log message during a compaction failure](https://github.com/lightningnetwork/lnd/issues/5937) +* [A bug has been fixed in channeldb that uses the return value without checking error](https://github.com/lightningnetwork/lnd/pull/6012) # Contributors (Alphabetical Order) -* Jamie Turley \ No newline at end of file +* Jamie Turley +* nayuta-ueno \ No newline at end of file