mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-19 12:01:27 +02:00
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:
committed by
Olaoluwa Osuntokun
parent
01e9bb2bff
commit
8cfb53f64a
@@ -79,6 +79,7 @@ func createTestPeer(notifier chainntnfs.ChainNotifier,
|
||||
bobDustLimit := btcutil.Amount(1300)
|
||||
csvTimeoutAlice := uint32(5)
|
||||
csvTimeoutBob := uint32(4)
|
||||
isAliceInitiator := true
|
||||
|
||||
prevOut := &wire.OutPoint{
|
||||
Hash: channels.TestHdSeed,
|
||||
@@ -162,6 +163,7 @@ func createTestPeer(notifier chainntnfs.ChainNotifier,
|
||||
aliceCommitTx, bobCommitTx, err := lnwallet.CreateCommitmentTxns(
|
||||
channelBal, channelBal, &aliceCfg, &bobCfg, aliceCommitPoint,
|
||||
bobCommitPoint, *fundingTxIn, channeldb.SingleFunderTweaklessBit,
|
||||
isAliceInitiator, 0,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
@@ -229,7 +231,7 @@ func createTestPeer(notifier chainntnfs.ChainNotifier,
|
||||
FundingOutpoint: *prevOut,
|
||||
ShortChannelID: shortChanID,
|
||||
ChanType: channeldb.SingleFunderTweaklessBit,
|
||||
IsInitiator: true,
|
||||
IsInitiator: isAliceInitiator,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: bobCommitPoint,
|
||||
RevocationProducer: alicePreimageProducer,
|
||||
@@ -246,7 +248,7 @@ func createTestPeer(notifier chainntnfs.ChainNotifier,
|
||||
IdentityPub: bobKeyPub,
|
||||
FundingOutpoint: *prevOut,
|
||||
ChanType: channeldb.SingleFunderTweaklessBit,
|
||||
IsInitiator: false,
|
||||
IsInitiator: !isAliceInitiator,
|
||||
Capacity: channelCapacity,
|
||||
RemoteCurrentRevocation: aliceCommitPoint,
|
||||
RevocationProducer: bobPreimageProducer,
|
||||
|
Reference in New Issue
Block a user