mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-09 09:15:35 +02:00
channeldb: attach DB to channel in FetchHistoricalChannel
This commit is contained in:
@@ -1299,6 +1299,8 @@ func (d *DB) FetchHistoricalChannel(outPoint *wire.OutPoint) (*OpenChannel, erro
|
||||
}
|
||||
|
||||
channel, err = fetchOpenChannel(chanBucket, outPoint)
|
||||
|
||||
channel.Db = d
|
||||
return err
|
||||
}, func() {
|
||||
channel = nil
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user