Skip to content

Commit 05b821d

Browse files
committed
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.
1 parent d380e92 commit 05b821d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tapfreighter/chain_porter.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,11 @@ func (p *ChainPorter) importLocalAddresses(ctx context.Context,
831831
func createDummyOutput() *wire.TxOut {
832832
// The dummy PkScript is the same size as an encoded P2TR output.
833833
newOutput := wire.TxOut{
834-
Value: int64(tapsend.DummyAmtSats),
835-
PkScript: make([]byte, 34),
834+
Value: int64(tapsend.DummyAmtSats),
835+
PkScript: append(
836+
[]byte{txscript.OP_1, txscript.OP_DATA_32},
837+
make([]byte, 32)...,
838+
),
836839
}
837840
return &newOutput
838841
}

0 commit comments

Comments
 (0)