Skip to content

Commit

Permalink
walletrpc+lncli: add new param. to bumpfee rpc.
Browse files Browse the repository at this point in the history
Add new parameter deadline-delta to the bumpfee request and only
allow it to be used when the budget value is used as well.
  • Loading branch information
ziggie1984 committed Feb 6, 2025
1 parent e403243 commit de62b21
Show file tree
Hide file tree
Showing 5 changed files with 479 additions and 409 deletions.
37 changes: 29 additions & 8 deletions cmd/commands/walletrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,10 @@ var bumpFeeCommand = cli.Command{
cli.Uint64Flag{
Name: "conf_target",
Usage: `
The deadline in number of blocks that the input should be spent within.
When not set, for new inputs, the default value (1008) is used; for
exiting inputs, their current values will be retained.`,
The conf target is the starting fee rate of the fee function experessed
in the number of blocks. So instead of using sat_per_vbyte the conf
target can be specified and LND will query its fee estimator for the
current fee rate for the given target.`,
},
cli.Uint64Flag{
Name: "sat_per_byte",
Expand Down Expand Up @@ -307,6 +308,25 @@ var bumpFeeCommand = cli.Command{
the budget for fee bumping; for existing inputs, their current budgets
will be retained.`,
},
cli.Uint64Flag{
Name: "deadline-delta",
Usage: `
The deadline-delta is the width of the fee function LND will use to
bump the transaction after a new block comes in. It is important to
note that this parameter ties closely to the budget parameter so this
parameter is only allowed if budget was preexisting in the RBF case
or a budget value is also specified. To give an example if you specify
a deadline-delta of 1 this means that the whole budget will be used to
bump the transaction (will be capped by the max fee rate setting). The
value of 1 is a special case. For other values a fee function will be
created with the starting fee rate as the initial value and the budget
as the last value of the fee function. So if you specify e.g. 5 for
the width a fee function with either a starting fee rate will be
created with the budget value as the maximum fee rate (or the max fee
cap). If no starting fee rate is provided the block estimation with
the value 5 will be used as a starting fee rate but the max fee rate
remains the same.`,
},
},
Action: actionDecorator(bumpFee),
}
Expand Down Expand Up @@ -344,11 +364,12 @@ func bumpFee(ctx *cli.Context) error {
}

resp, err := client.BumpFee(ctxc, &walletrpc.BumpFeeRequest{
Outpoint: protoOutPoint,
TargetConf: uint32(ctx.Uint64("conf_target")),
Immediate: immediate,
Budget: ctx.Uint64("budget"),
SatPerVbyte: ctx.Uint64("sat_per_vbyte"),
Outpoint: protoOutPoint,
TargetConf: uint32(ctx.Uint64("conf_target")),
Immediate: immediate,
Budget: ctx.Uint64("budget"),
SatPerVbyte: ctx.Uint64("sat_per_vbyte"),
DeadlineDelta: ctx.Uint64("deadline-delta"),
})
if err != nil {
return err
Expand Down
Loading

0 comments on commit de62b21

Please sign in to comment.