lnrpc+routerrpc+lncli: add allow_self_payments safety flag

This commit is contained in:
Joost Jager
2019-11-25 14:13:21 +01:00
parent f8e9efbf99
commit 2d19201ede
8 changed files with 759 additions and 689 deletions

View File

@@ -2084,6 +2084,10 @@ func paymentFlags() []cli.Flag {
Name: "force, f",
Usage: "will skip payment request confirmation",
},
cli.BoolFlag{
Name: "allow_self_payment",
Usage: "allow sending a circular payment to self",
},
}
}
@@ -2302,6 +2306,8 @@ func sendPaymentRequest(ctx *cli.Context, req *lnrpc.SendRequest) error {
req.CltvLimit = uint32(ctx.Int(cltvLimitFlag.Name))
req.AllowSelfPayment = ctx.Bool("allow_self_payment")
amt := req.Amt
if req.PaymentRequest != "" {