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

View File

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