Skip to content

Commit

Permalink
Allow pay command to specify amount even when it is part of the invoice
Browse files Browse the repository at this point in the history
Implements possible solution 1 
as described in this [https://github.com/ElementsProject/lightning/issues/7020](this issue).

This should allow you to use the pay command with a rune that restricts the amount that can be spent, even when the invoice contains the amount.
  • Loading branch information
Amperstrand authored Jan 28, 2024
1 parent 040af90 commit 91d953e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/pay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,9 +1183,9 @@ static struct command_result *json_pay(struct command *cmd,
return command_fail(cmd, PAY_INVOICE_EXPIRED, "Invoice expired");

if (invmsat) {
if (msat) {
if (msat && *msat != *invmsat) {
return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
"msatoshi parameter unnecessary");
"msatoshi parameter must be None or equal to value decoded from invoice");
}
p->amount = *invmsat;
tal_free(invmsat);
Expand Down

0 comments on commit 91d953e

Please sign in to comment.