fetchinvoice: don't consider "msat" a change if fetchinvoice specified it.

We don't automatically *reject* an invoice which asks for a different
msat than we specified (caller may!), but we don't bother noting it
unless it is different.

Reported-by: @shesek
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-07-21 15:07:39 +09:30
committed by neil saitug
parent 0a0b2ce940
commit 57cc4e3c34
2 changed files with 14 additions and 2 deletions

View File

@@ -253,8 +253,11 @@ static struct command_result *handle_invreq_response(struct command *cmd,
if ((badfield = field_diff(sent->invreq, inv, payer_info)))
goto badinv;
/* Get the amount we expected. */
if (sent->offer->amount && !sent->offer->currency) {
/* Get the amount we expected: firstly, if that's what we sent,
* secondly, if specified in the invoice. */
if (sent->invreq->amount) {
expected_amount = tal_dup(tmpctx, u64, sent->invreq->amount);
} else if (sent->offer->amount && !sent->offer->currency) {
expected_amount = tal(tmpctx, u64);
*expected_amount = *sent->offer->amount;