channeldb: attach DB to channel in FetchHistoricalChannel

This commit is contained in:
yyforyongyu
2021-08-30 18:58:43 +08:00
parent e513057eae
commit 556b038398
2 changed files with 6 additions and 3 deletions

View File

@@ -717,9 +717,10 @@ func TestFetchHistoricalChannel(t *testing.T) {
t.Fatalf("unexepected error getting channel: %v", err)
}
// Set the db on our channel to nil so that we can check that all other
// fields on the channel equal those on the historical channel.
channel.Db = nil
// FetchHistoricalChannel will attach the cdb to channel.Db, we set it
// here so that we can check that all other fields on the channel equal
// those on the historical channel.
channel.Db = cdb
if !reflect.DeepEqual(histChannel, channel) {
t.Fatalf("expected: %v, got: %v", channel, histChannel)