multi: update funding workflow to be aware of new tweakless commits
In this commit, we update the funding workflow to be aware of the new channel type that doesn't tweak the remote party's output within the non-delay script on their commitment transaction. To do this, we now allow the caller of `InnitChannelReservation` to signal if they want the old or new (tweakless) commitment style. The funding tests are also updated to test both funding variants, as we'll still need to understand the legacy format for older nodes.
This commit is contained in:
9 files changed
+75
-28
No files matched your search
+12
-4
@@ -88,8 +88,11 @@ var (
|
||||
// allocated to each side. Within the channel, Alice is the initiator. The
|
||||
// function also returns a "cleanup" function that is meant to be called once
|
||||
// the test has been finalized. The clean up function will remote all temporary
|
||||
// files created
|
||||
func CreateTestChannels(tweaklessCommits bool) (*LightningChannel, *LightningChannel, func(), error) {
|
||||
// files created. If tweaklessCommits is true, then the commits within the
|
||||
// channels will use the new format, otherwise the legacy format.
|
||||
func CreateTestChannels(tweaklessCommits bool) (
|
||||
*LightningChannel, *LightningChannel, func(), error) {
|
||||
|
||||
channelCapacity, err := btcutil.NewAmount(10)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
@@ -271,7 +274,7 @@ func CreateTestChannels(tweaklessCommits bool) (*LightningChannel, *LightningCha
|
||||
IdentityPub: aliceKeys[0].PubKey(),
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: channeldb.SingleFunder,
|
||||
ChanType: channeldb.SingleFunderTweakless,
|
||||
IsInitiator: true,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: bobCommitPoint,
|
||||
@@ -289,7 +292,7 @@ func CreateTestChannels(tweaklessCommits bool) (*LightningChannel, *LightningCha
|
||||
IdentityPub: bobKeys[0].PubKey(),
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: channeldb.SingleFunder,
|
||||
ChanType: channeldb.SingleFunderTweakless,
|
||||
IsInitiator: false,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: aliceCommitPoint,
|
||||
@@ -301,6 +304,11 @@ func CreateTestChannels(tweaklessCommits bool) (*LightningChannel, *LightningCha
|
||||
Packager: channeldb.NewChannelPackager(shortChanID),
|
||||
}
|
||||
|
||||
if !tweaklessCommits {
|
||||
aliceChannelState.ChanType = channeldb.SingleFunder
|
||||
bobChannelState.ChanType = channeldb.SingleFunder
|
||||
}
|
||||
|
||||
aliceSigner := &input.MockSigner{Privkeys: aliceKeys}
|
||||
bobSigner := &input.MockSigner{Privkeys: bobKeys}
|
||||
|
||||
|
||||
Reference in new issue
Block a user