mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-20 13:04:28 +02:00
channeldb: BigSize migration, store zero-conf, scid-alias bits
This introduces a BigSize migration that is used to expand the width of the ChannelStatus and ChannelType fields. Three channel "types" are added - ZeroConfBit, ScidAliasChanBit, and ScidAliasFeatureBit. ScidAliasChanBit denotes that the scid-alias channel type was negotiated for the channel. ScidAliasFeatureBit denotes that the scid-alias feature bit was negotiated during the *lifetime* of the channel. Several helper functions on the OpenChannel struct are exposed to aid callers from different packages. The RefreshShortChanID has been renamed to Refresh. A new function BroadcastHeight is used to guard access to the mutable FundingBroadcastHeight member. This prevents data races.
This commit is contained in:
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration25"
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration26"
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration27"
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration29"
|
||||
"github.com/lightningnetwork/lnd/channeldb/migration_01_to_11"
|
||||
"github.com/lightningnetwork/lnd/clock"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
@@ -226,6 +227,14 @@ var (
|
||||
number: 27,
|
||||
migration: migration27.MigrateHistoricalBalances,
|
||||
},
|
||||
{
|
||||
number: 28,
|
||||
migration: mig.CreateTLB(chanIDBucket),
|
||||
},
|
||||
{
|
||||
number: 29,
|
||||
migration: migration29.MigrateChanID,
|
||||
},
|
||||
}
|
||||
|
||||
// Big endian is the preferred byte order, due to cursor scans over
|
||||
@@ -352,6 +361,7 @@ var dbTopLevelBuckets = [][]byte{
|
||||
metaBucket,
|
||||
closeSummaryBucket,
|
||||
outpointBucket,
|
||||
chanIDBucket,
|
||||
historicalChannelBucket,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user