mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-06 05:26:38 +02:00
multi: convert the existing channeldb.ChannelType uint8 into a bit field
In this commit, we convert the existing `channeldb.ChannelType` type into a _bit field_. This doesn't require us to change the current serialization or interpretation or the type as it is, since all the current defined values us a distinct bit. This PR lays the ground work for any future changes that may introduce new channel types (like anchor outputs), and also any changes that may modify the existing invariants around channels (if we're the initiator, we always have the funding transaction).
This commit is contained in:
@ -274,7 +274,7 @@ func CreateTestChannels(tweaklessCommits bool) (
|
||||
IdentityPub: aliceKeys[0].PubKey(),
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: channeldb.SingleFunderTweakless,
|
||||
ChanType: channeldb.SingleFunderTweaklessBit,
|
||||
IsInitiator: true,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: bobCommitPoint,
|
||||
@ -292,7 +292,7 @@ func CreateTestChannels(tweaklessCommits bool) (
|
||||
IdentityPub: bobKeys[0].PubKey(),
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: channeldb.SingleFunderTweakless,
|
||||
ChanType: channeldb.SingleFunderTweaklessBit,
|
||||
IsInitiator: false,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: aliceCommitPoint,
|
||||
@ -305,8 +305,8 @@ func CreateTestChannels(tweaklessCommits bool) (
|
||||
}
|
||||
|
||||
if !tweaklessCommits {
|
||||
aliceChannelState.ChanType = channeldb.SingleFunder
|
||||
bobChannelState.ChanType = channeldb.SingleFunder
|
||||
aliceChannelState.ChanType = channeldb.SingleFunderBit
|
||||
bobChannelState.ChanType = channeldb.SingleFunderBit
|
||||
}
|
||||
|
||||
aliceSigner := &input.MockSigner{Privkeys: aliceKeys}
|
||||
|
Reference in New Issue
Block a user