From 0d3bed66c0e130123fb07aa9df6ab8546dfd35c3 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 7 Feb 2023 14:15:40 +0200 Subject: [PATCH] lnwallet: properly set witness script in CommitScriptToSelf --- lnwallet/commitment.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lnwallet/commitment.go b/lnwallet/commitment.go index 22d5c3bb6..b9659d916 100644 --- a/lnwallet/commitment.go +++ b/lnwallet/commitment.go @@ -209,7 +209,7 @@ func CommitScriptToSelf(chanType channeldb.ChannelType, initiator bool, // // Our "redeem" script here is just the taproot witness program. case chanType.IsTaproot(): - toLocalOutputKey, err := input.TaprootCommitScriptToSelf( + toLocalScriptTree, err := input.NewLocalCommitScriptTree( csvDelay, selfKey, revokeKey, ) if err != nil { @@ -218,7 +218,7 @@ func CommitScriptToSelf(chanType channeldb.ChannelType, initiator bool, } toLocalPkScript, err := input.PayToTaprootScript( - toLocalOutputKey, + toLocalScriptTree.TaprootKey, ) if err != nil { return nil, fmt.Errorf("unable to gen taproot "+ @@ -226,7 +226,8 @@ func CommitScriptToSelf(chanType channeldb.ChannelType, initiator bool, } return &ScriptInfo{ - PkScript: toLocalPkScript, + WitnessScript: toLocalScriptTree.SettleLeaf.Script, + PkScript: toLocalPkScript, }, nil // If we are the initiator of a leased channel, then we have an