mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 01:56:52 +02:00
lnrpc+routerrpc+lncli: add allow_self_payments safety flag
This commit is contained in:
@@ -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 != "" {
|
||||
|
Reference in New Issue
Block a user