mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
multi: add tapscript root to gossip message
This commit is contained in:
@@ -1092,8 +1092,8 @@ func (b *Builder) addZombieEdge(chanID uint64) error {
|
||||
// segwit v1 (taproot) channels.
|
||||
//
|
||||
// TODO(roasbeef: export and use elsewhere?
|
||||
func makeFundingScript(bitcoinKey1, bitcoinKey2 []byte,
|
||||
chanFeatures []byte) ([]byte, error) {
|
||||
func makeFundingScript(bitcoinKey1, bitcoinKey2 []byte, chanFeatures []byte,
|
||||
tapscriptRoot fn.Option[chainhash.Hash]) ([]byte, error) {
|
||||
|
||||
legacyFundingScript := func() ([]byte, error) {
|
||||
witnessScript, err := input.GenMultiSigScript(
|
||||
@@ -1140,7 +1140,7 @@ func makeFundingScript(bitcoinKey1, bitcoinKey2 []byte,
|
||||
}
|
||||
|
||||
fundingScript, _, err := input.GenTaprootFundingScript(
|
||||
pubKey1, pubKey2, 0, fn.None[chainhash.Hash](),
|
||||
pubKey1, pubKey2, 0, tapscriptRoot,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1272,7 +1272,7 @@ func (b *Builder) processUpdate(msg interface{},
|
||||
// reality.
|
||||
fundingPkScript, err := makeFundingScript(
|
||||
msg.BitcoinKey1Bytes[:], msg.BitcoinKey2Bytes[:],
|
||||
msg.Features,
|
||||
msg.Features, msg.TapscriptRoot,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user