lncli: add label flag to send many and send coins

This commit is contained in:
carla 2020-05-18 14:13:24 +02:00
parent 93a1b61218
commit 52137459e4
No known key found for this signature in database
GPG Key ID: 4CA7FE54A6213C91

@ -194,6 +194,11 @@ func estimateFees(ctx *cli.Context) error {
return nil return nil
} }
var txLabelFlag = cli.StringFlag{
Name: "label",
Usage: "(optional) a label for the transaction",
}
var sendCoinsCommand = cli.Command{ var sendCoinsCommand = cli.Command{
Name: "sendcoins", Name: "sendcoins",
Category: "On-chain", Category: "On-chain",
@ -236,6 +241,7 @@ var sendCoinsCommand = cli.Command{
"sat/byte that should be used when crafting " + "sat/byte that should be used when crafting " +
"the transaction", "the transaction",
}, },
txLabelFlag,
}, },
Action: actionDecorator(sendCoins), Action: actionDecorator(sendCoins),
} }
@ -295,6 +301,7 @@ func sendCoins(ctx *cli.Context) error {
TargetConf: int32(ctx.Int64("conf_target")), TargetConf: int32(ctx.Int64("conf_target")),
SatPerByte: ctx.Int64("sat_per_byte"), SatPerByte: ctx.Int64("sat_per_byte"),
SendAll: ctx.Bool("sweepall"), SendAll: ctx.Bool("sweepall"),
Label: ctx.String(txLabelFlag.Name),
} }
txid, err := client.SendCoins(ctxb, req) txid, err := client.SendCoins(ctxb, req)
if err != nil { if err != nil {
@ -450,6 +457,7 @@ var sendManyCommand = cli.Command{
Usage: "(optional) a manual fee expressed in sat/byte that should be " + Usage: "(optional) a manual fee expressed in sat/byte that should be " +
"used when crafting the transaction", "used when crafting the transaction",
}, },
txLabelFlag,
}, },
Action: actionDecorator(sendMany), Action: actionDecorator(sendMany),
} }
@ -475,6 +483,7 @@ func sendMany(ctx *cli.Context) error {
AddrToAmount: amountToAddr, AddrToAmount: amountToAddr,
TargetConf: int32(ctx.Int64("conf_target")), TargetConf: int32(ctx.Int64("conf_target")),
SatPerByte: ctx.Int64("sat_per_byte"), SatPerByte: ctx.Int64("sat_per_byte"),
Label: ctx.String(txLabelFlag.Name),
}) })
if err != nil { if err != nil {
return err return err