multi: add tapscript root to gossip message

This commit is contained in:
Oliver Gugger
2024-05-17 12:39:12 +02:00
parent bcb66585d4
commit 5c854a2f53
4 changed files with 30 additions and 10 deletions

View File

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