lncli: expose max payment htlcs

This commit is contained in:
Joost Jager 2020-03-27 14:44:44 +01:00
parent e9bd691e6a
commit f5c3f930c4
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

View File

@ -52,6 +52,13 @@ var (
Usage: "if set, intermediate payment state updates will be " +
"displayed",
}
maxHtlcsFlag = cli.UintFlag{
Name: "max_htlcs",
Usage: "the maximum number of partial payments that may be " +
"used",
Value: 1,
}
)
// paymentFlags returns common flags for sendpayment and payinvoice.
@ -88,7 +95,7 @@ func paymentFlags() []cli.Flag {
Name: "allow_self_payment",
Usage: "allow sending a circular payment to self",
},
dataFlag, showInflightFlag,
dataFlag, showInflightFlag, maxHtlcsFlag,
}
}
@ -318,6 +325,8 @@ func sendPaymentRequest(ctx *cli.Context,
req.AllowSelfPayment = ctx.Bool("allow_self_payment")
req.MaxHtlcs = uint32(ctx.Uint(maxHtlcsFlag.Name))
// Parse custom data records.
data := ctx.String(dataFlag.Name)
if data != "" {