Skip to content

Commit

Permalink
tapfreighter: make dummy output look like valid P2TR output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guggero committed Feb 7, 2024
1 parent 518a680 commit 3bd8520
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tapfreighter/chain_porter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3bd8520

Please sign in to comment.