mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
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:
committed by
Oliver Gugger
parent
8588c9bfd7
commit
1aae47fd71
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/btcsuite/btcd/txscript"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcwallet/waddrmgr"
|
||||
"github.com/lightningnetwork/lnd/fn"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -21,6 +22,15 @@ const (
|
||||
PubKeyFormatCompressedOdd byte = 0x03
|
||||
)
|
||||
|
||||
// AuxTapLeaf is a type alias for an optional tapscript leaf that may be added
|
||||
// to the tapscript tree of HTLC and commitment outputs.
|
||||
type AuxTapLeaf = fn.Option[txscript.TapLeaf]
|
||||
|
||||
// NoneTapLeaf returns an empty optional tapscript leaf.
|
||||
func NoneTapLeaf() AuxTapLeaf {
|
||||
return fn.None[txscript.TapLeaf]()
|
||||
}
|
||||
|
||||
// NewTxSigHashesV0Only returns a new txscript.TxSigHashes instance that will
|
||||
// only calculate the sighash midstate values for segwit v0 inputs and can
|
||||
// therefore never be used for transactions that want to spend segwit v1
|
||||
|
Reference in New Issue
Block a user