lnwallet: support transactions and scripts for new commitment type
This commit modifies the channel state machine to be able to derive the proper commitment and second-level HTLC output scripts required by the new script-enforced leased channel commitment type.
This commit is contained in:
1 parent
01e9bb2bff
commit
8cfb53f64a
11 files changed
+230
-98
No files matched your search
@@ -119,6 +119,7 @@ func CreateTestChannels(chanType channeldb.ChannelType) (
|
||||
channelBal := channelCapacity / 2
|
||||
csvTimeoutAlice := uint32(5)
|
||||
csvTimeoutBob := uint32(4)
|
||||
isAliceInitiator := true
|
||||
|
||||
prevOut := &wire.OutPoint{
|
||||
Hash: chainhash.Hash(testHdSeed),
|
||||
@@ -223,7 +224,7 @@ func CreateTestChannels(chanType channeldb.ChannelType) (
|
||||
|
||||
aliceCommitTx, bobCommitTx, err := CreateCommitmentTxns(
|
||||
channelBal, channelBal, &aliceCfg, &bobCfg, aliceCommitPoint,
|
||||
bobCommitPoint, *fundingTxIn, chanType,
|
||||
bobCommitPoint, *fundingTxIn, chanType, isAliceInitiator, 0,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
@@ -318,7 +319,7 @@ func CreateTestChannels(chanType channeldb.ChannelType) (
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: chanType,
|
||||
IsInitiator: true,
|
||||
IsInitiator: isAliceInitiator,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: bobCommitPoint,
|
||||
RevocationProducer: alicePreimageProducer,
|
||||
@@ -336,7 +337,7 @@ func CreateTestChannels(chanType channeldb.ChannelType) (
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: chanType,
|
||||
IsInitiator: false,
|
||||
IsInitiator: !isAliceInitiator,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: aliceCommitPoint,
|
||||
RevocationProducer: bobPreimageProducer,
|
||||
|
||||
Reference in new issue
Block a user