funding: use p2tr by default for batch_open_channel

In LND v0.15.1, batch_open_channel used p2tr by default
for change output. However, in a later version, a breaking
change has been fixed in FundPSBT to make the change type
configurable (default to p2wkh). As batch_open_channel
uses FundPsbt, we need to put back p2tr as default for
change output
This commit is contained in:
Torakushi committed 2023-04-17 17:37:51 +02:00
1 parent 66a85bf9db
commit 0445fef7ad
3 files changed
+32

No files matched your search

+2
View File
@@ -320,6 +320,7 @@ func (b *Batcher) BatchFund(ctx context.Context,
// anyway.
firstReq := b.channels[0].fundingReq
feeRateSatPerKVByte := firstReq.FundingFeePerKw.FeePerKVByte()
changeType := walletrpc.ChangeAddressType_CHANGE_ADDRESS_TYPE_P2TR
fundPsbtReq := &walletrpc.FundPsbtRequest{
Template: &walletrpc.FundPsbtRequest_Raw{
Raw: txTemplate,
@@ -329,6 +330,7 @@ func (b *Batcher) BatchFund(ctx context.Context,
},
MinConfs: firstReq.MinConfs,
SpendUnconfirmed: firstReq.MinConfs == 0,
ChangeType: changeType,
}
fundPsbtResp, err := b.cfg.WalletKitServer.FundPsbt(ctx, fundPsbtReq)
if err != nil {