mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 05:08:13 +02:00
contractcourt: catch error when no historical bucket exists
For older nodes, this bucket was never created, so we'll get an error if we try and query it. In this commit, we catch this error like we do when a given channel doesn't have the information (but the bucket actually exists). Fixes #6155
This commit is contained in:
@@ -717,10 +717,11 @@ func TestFetchHistoricalChannel(t *testing.T) {
|
||||
// Create a an open channel in the database.
|
||||
channel := createTestChannel(t, cdb, openChannelOption())
|
||||
|
||||
// First, try to lookup a channel when the bucket does not
|
||||
// exist.
|
||||
// First, try to lookup a channel when nothing is in the bucket. As the
|
||||
// bucket is auto-created (on start up), we'll get a channel not found
|
||||
// error.
|
||||
_, err = cdb.FetchHistoricalChannel(&channel.FundingOutpoint)
|
||||
if err != ErrNoHistoricalBucket {
|
||||
if err != ErrChannelNotFound {
|
||||
t.Fatalf("expected no bucket, got: %v", err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user