walletrpc-lncli: add new bumpforceclosefee cmd.
Replace (hide) the old bumpclosefee cmd with the new bumpforceclosefee cmd to avoid confusion which closing transactions can be bumped.
This commit is contained in:
1 file changed
+59
-18
@@ -71,6 +71,7 @@ func walletCommands() []cli.Command {
|
|||||||
pendingSweepsCommand,
|
pendingSweepsCommand,
|
||||||
bumpFeeCommand,
|
bumpFeeCommand,
|
||||||
bumpCloseFeeCommand,
|
bumpCloseFeeCommand,
|
||||||
|
bumpForceCloseFeeCommand,
|
||||||
listSweepsCommand,
|
listSweepsCommand,
|
||||||
labelTxCommand,
|
labelTxCommand,
|
||||||
publishTxCommand,
|
publishTxCommand,
|
||||||
@@ -266,14 +267,19 @@ func bumpFee(ctx *cli.Context) error {
|
|||||||
|
|
||||||
var bumpCloseFeeCommand = cli.Command{
|
var bumpCloseFeeCommand = cli.Command{
|
||||||
Name: "bumpclosefee",
|
Name: "bumpclosefee",
|
||||||
Usage: "Bumps the fee of a channel closing transaction.",
|
Usage: "Bumps the fee of a channel force closing transaction.",
|
||||||
ArgsUsage: "channel_point",
|
ArgsUsage: "channel_point",
|
||||||
|
Hidden: true,
|
||||||
Description: `
|
Description: `
|
||||||
This command allows the fee of a channel closing transaction to be
|
This command works only for unilateral closes of anchor channels. It
|
||||||
increased by using the child-pays-for-parent mechanism. It will instruct
|
allows the fee of a channel force closing transaction to be increased by
|
||||||
the sweeper to sweep the anchor outputs of transactions in the set
|
using the child-pays-for-parent mechanism. It will instruct the sweeper
|
||||||
of valid commitments for the specified channel at the requested fee
|
to sweep the anchor outputs of the closing transaction at the requested
|
||||||
rate or confirmation target.
|
fee rate or confirmation target. The specified fee rate will be the
|
||||||
|
effective fee rate taking the parent fee into account.
|
||||||
|
Depending on the sweeper configuration (batchwindowduration) the sweeptx
|
||||||
|
will not be published immediately.
|
||||||
|
NOTE: This cmd is DEPRECATED please use bumpforceclosefee instead.
|
||||||
`,
|
`,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.Uint64Flag{
|
cli.Uint64Flag{
|
||||||
@@ -292,10 +298,44 @@ var bumpCloseFeeCommand = cli.Command{
|
|||||||
"should be used when sweeping the output",
|
"should be used when sweeping the output",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: actionDecorator(bumpCloseFee),
|
Action: actionDecorator(bumpForceCloseFee),
|
||||||
}
|
}
|
||||||
|
|
||||||
func bumpCloseFee(ctx *cli.Context) error {
|
var bumpForceCloseFeeCommand = cli.Command{
|
||||||
|
Name: "bumpforceclosefee",
|
||||||
|
Usage: "Bumps the fee of a channel force closing transaction.",
|
||||||
|
ArgsUsage: "channel_point",
|
||||||
|
Description: `
|
||||||
|
This command works only for unilateral closes of anchor channels. It
|
||||||
|
allows the fee of a channel force closing transaction to be increased by
|
||||||
|
using the child-pays-for-parent mechanism. It will instruct the sweeper
|
||||||
|
to sweep the anchor outputs of the closing transaction at the requested
|
||||||
|
fee rate or confirmation target. The specified fee rate will be the
|
||||||
|
effective fee rate taking the parent fee into account.
|
||||||
|
Depending on the sweeper configuration (batchwindowduration) the sweeptx
|
||||||
|
will not be published immediately.
|
||||||
|
`,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
cli.Uint64Flag{
|
||||||
|
Name: "conf_target",
|
||||||
|
Usage: "the number of blocks that the output should " +
|
||||||
|
"be swept on-chain within",
|
||||||
|
},
|
||||||
|
cli.Uint64Flag{
|
||||||
|
Name: "sat_per_byte",
|
||||||
|
Usage: "Deprecated, use sat_per_vbyte instead.",
|
||||||
|
Hidden: true,
|
||||||
|
},
|
||||||
|
cli.Uint64Flag{
|
||||||
|
Name: "sat_per_vbyte",
|
||||||
|
Usage: "a manual fee expressed in sat/vbyte that " +
|
||||||
|
"should be used when sweeping the output",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Action: actionDecorator(bumpForceCloseFee),
|
||||||
|
}
|
||||||
|
|
||||||
|
func bumpForceCloseFee(ctx *cli.Context) error {
|
||||||
ctxc := getContext()
|
ctxc := getContext()
|
||||||
|
|
||||||
// Display the command's help message if we do not have the expected
|
// Display the command's help message if we do not have the expected
|
||||||
@@ -368,19 +408,20 @@ func bumpCloseFee(ctx *cli.Context) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bump fee of the anchor sweep.
|
resp, err := walletClient.BumpFee(
|
||||||
fmt.Printf("Bumping fee of %v:%v\n",
|
ctxc, &walletrpc.BumpFeeRequest{
|
||||||
sweepTxID, sweep.Outpoint.OutputIndex)
|
Outpoint: sweep.Outpoint,
|
||||||
|
TargetConf: uint32(ctx.Uint64("conf_target")),
|
||||||
_, err = walletClient.BumpFee(ctxc, &walletrpc.BumpFeeRequest{
|
SatPerVbyte: ctx.Uint64(feeRateFlag),
|
||||||
Outpoint: sweep.Outpoint,
|
Force: true,
|
||||||
TargetConf: uint32(ctx.Uint64("conf_target")),
|
})
|
||||||
SatPerVbyte: ctx.Uint64(feeRateFlag),
|
|
||||||
Force: true,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bump fee of the anchor sweep.
|
||||||
|
fmt.Printf("Bumping fee of %v:%v: %v\n",
|
||||||
|
sweepTxID, sweep.Outpoint.OutputIndex, resp.GetStatus())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in new issue
Block a user