input+lnwallet: update taproot scripts to accept optional aux leaf

In this commit, we update all the taproot scripts to also accept an
optional aux leaf. This aux leaf can be used to add more redemption
paths for advanced channels, or just as an extra commitment space.
This commit is contained in:
Olaoluwa Osuntokun
2024-03-15 11:43:21 -04:00
committed by Oliver Gugger
parent 08a6c9c738
commit 002787f229
11 changed files with 287 additions and 99 deletions

View File

@ -10,6 +10,7 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwallet"
@ -136,6 +137,7 @@ func genTaskTest(
if chanType.IsTaproot() {
scriptTree, _ := input.NewLocalCommitScriptTree(
csvDelay, toLocalPK, revPK,
fn.None[txscript.TapLeaf](),
)
pkScript, _ := input.PayToTaprootScript(
@ -189,7 +191,7 @@ func genTaskTest(
if chanType.IsTaproot() {
scriptTree, _ := input.NewRemoteCommitScriptTree(
toRemotePK,
toRemotePK, fn.None[txscript.TapLeaf](),
)
pkScript, _ := input.PayToTaprootScript(