lnwallet: properly set witness script in CommitScriptToSelf

This commit is contained in:
Olaoluwa Osuntokun 2023-02-07 14:15:40 +02:00
parent a5f67b451e
commit 0d3bed66c0
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -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