From 3bd8520acabb6dc34449ce0f3a29145fda8a448a Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 7 Feb 2024 10:24:05 +0100 Subject: [PATCH] tapfreighter: make dummy output look like valid P2TR output In order to be able to pass the dummy outputs to the lnd FundPsbt call we need to make them look more like actual P2TR outputs. --- tapfreighter/chain_porter.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tapfreighter/chain_porter.go b/tapfreighter/chain_porter.go index f0bde0ee6..05c764ad6 100644 --- a/tapfreighter/chain_porter.go +++ b/tapfreighter/chain_porter.go @@ -830,8 +830,11 @@ func (p *ChainPorter) importLocalAddresses(ctx context.Context, func createDummyOutput() *wire.TxOut { // The dummy PkScript is the same size as an encoded P2TR output. newOutput := wire.TxOut{ - Value: int64(tapscript.DummyAmtSats), - PkScript: make([]byte, 34), + Value: int64(tapscript.DummyAmtSats), + PkScript: append( + []byte{txscript.OP_1, txscript.OP_DATA_32}, + make([]byte, 32)..., + ), } return &newOutput }