mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-03 17:26:57 +01:00
Merge pull request #6159 from Roasbeef/fix-historical-migration
contractcourt: catch error when no historical bucket exists
This commit is contained in:
commit
3829385073
4 changed files with 12 additions and 4 deletions
|
@ -329,6 +329,7 @@ var dbTopLevelBuckets = [][]byte{
|
||||||
metaBucket,
|
metaBucket,
|
||||||
closeSummaryBucket,
|
closeSummaryBucket,
|
||||||
outpointBucket,
|
outpointBucket,
|
||||||
|
historicalChannelBucket,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wipe completely deletes all saved state within all used buckets within the
|
// Wipe completely deletes all saved state within all used buckets within the
|
||||||
|
|
|
@ -717,10 +717,11 @@ func TestFetchHistoricalChannel(t *testing.T) {
|
||||||
// Create a an open channel in the database.
|
// Create a an open channel in the database.
|
||||||
channel := createTestChannel(t, cdb, openChannelOption())
|
channel := createTestChannel(t, cdb, openChannelOption())
|
||||||
|
|
||||||
// First, try to lookup a channel when the bucket does not
|
// First, try to lookup a channel when nothing is in the bucket. As the
|
||||||
// exist.
|
// bucket is auto-created (on start up), we'll get a channel not found
|
||||||
|
// error.
|
||||||
_, err = cdb.FetchHistoricalChannel(&channel.FundingOutpoint)
|
_, err = cdb.FetchHistoricalChannel(&channel.FundingOutpoint)
|
||||||
if err != ErrNoHistoricalBucket {
|
if err != ErrChannelNotFound {
|
||||||
t.Fatalf("expected no bucket, got: %v", err)
|
t.Fatalf("expected no bucket, got: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -618,6 +618,8 @@ func (c *ChannelArbitrator) relaunchResolvers(commitSet *CommitSet,
|
||||||
// If we don't find this channel, then it may be the case that it
|
// If we don't find this channel, then it may be the case that it
|
||||||
// was closed before we started to retain the final state
|
// was closed before we started to retain the final state
|
||||||
// information for open channels.
|
// information for open channels.
|
||||||
|
case err == channeldb.ErrNoHistoricalBucket:
|
||||||
|
fallthrough
|
||||||
case err == channeldb.ErrChannelNotFound:
|
case err == channeldb.ErrChannelNotFound:
|
||||||
log.Warnf("ChannelArbitrator(%v): unable to fetch historical "+
|
log.Warnf("ChannelArbitrator(%v): unable to fetch historical "+
|
||||||
"state", c.cfg.ChanPoint)
|
"state", c.cfg.ChanPoint)
|
||||||
|
@ -1947,6 +1949,8 @@ func (c *ChannelArbitrator) prepContractResolutions(
|
||||||
// If we don't find this channel, then it may be the case that it
|
// If we don't find this channel, then it may be the case that it
|
||||||
// was closed before we started to retain the final state
|
// was closed before we started to retain the final state
|
||||||
// information for open channels.
|
// information for open channels.
|
||||||
|
case err == channeldb.ErrNoHistoricalBucket:
|
||||||
|
fallthrough
|
||||||
case err == channeldb.ErrChannelNotFound:
|
case err == channeldb.ErrChannelNotFound:
|
||||||
log.Warnf("ChannelArbitrator(%v): unable to fetch historical "+
|
log.Warnf("ChannelArbitrator(%v): unable to fetch historical "+
|
||||||
"state", c.cfg.ChanPoint)
|
"state", c.cfg.ChanPoint)
|
||||||
|
|
|
@ -69,7 +69,9 @@ connection from the watch-only node.
|
||||||
|
|
||||||
* [Fix duplicate db connection close](https://github.com/lightningnetwork/lnd/pull/6140)
|
* [Fix duplicate db connection close](https://github.com/lightningnetwork/lnd/pull/6140)
|
||||||
|
|
||||||
* [Fix a memory leak introduced by the new ping-header p2p enhancement](https://github.com/lightningnetwork/lnd/pull/6144]
|
* [Fix a memory leak introduced by the new ping-header p2p enhancement](https://github.com/lightningnetwork/lnd/pull/6144)
|
||||||
|
|
||||||
|
* [Fix an issue that would prevent very old nodes from starting up due to lack of a historical channel bucket](https://github.com/lightningnetwork/lnd/pull/6159)
|
||||||
|
|
||||||
|
|
||||||
## RPC Server
|
## RPC Server
|
||||||
|
|
Loading…
Add table
Reference in a new issue