Skip to content

Commit e9d48fa

Browse files
committed
tapd: bump maxFeeRatio for funded psbts
1 parent 1660f9c commit e9d48fa

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

rpcserver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,7 @@ func (r *rpcServer) CommitVirtualPsbts(ctx context.Context,
25822582
},
25832583
MinConfs: 1,
25842584
ChangeType: P2TRChangeType,
2585+
MaxFeeRatio: psbtMaxFeeRatio,
25852586
CustomLockId: req.CustomLockId,
25862587
LockExpirationSeconds: req.LockExpirationSeconds,
25872588
}

wallet_anchor.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ type LndRpcWalletAnchor struct {
2828
lnd *lndclient.LndServices
2929
}
3030

31+
// psbtMaxFeeRatio is the maximum ratio between fees paid and total output
32+
// amount produced. Since taproot assets can be anchored to outpoints that may
33+
// carry relatively small bitcoin amounts, we want to bump the allowed ratio
34+
// between fees paid and total produced output amount. This can prove useful in
35+
// high fee environments where we'd otherwise fail to fund the psbt.
36+
const psbtMaxFeeRatio = 1.00
37+
3138
// NewLndRpcWalletAnchor returns a new wallet anchor instance using the passed
3239
// lnd node.
3340
func NewLndRpcWalletAnchor(lnd *lndclient.LndServices) *LndRpcWalletAnchor {
@@ -89,8 +96,9 @@ func (l *LndRpcWalletAnchor) FundPsbt(ctx context.Context, packet *psbt.Packet,
8996
Fees: &walletrpc.FundPsbtRequest_SatPerVbyte{
9097
SatPerVbyte: satPerVByte,
9198
},
92-
MinConfs: int32(minConfs),
93-
ChangeType: defaultChangeType,
99+
MinConfs: int32(minConfs),
100+
ChangeType: defaultChangeType,
101+
MaxFeeRatio: psbtMaxFeeRatio,
94102
},
95103
)
96104
if err != nil {

0 commit comments

Comments
 (0)