fetchinvoice: amount_msat not msat.

The name in the spec is `msat`, but I don't want to make an API exception.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `fetchinvoice` `changes` `amount_msat`
Changelog-Deprecated: JSON-RPC: `fetchinvoice` `changes` `msat` (use `amount_msat`)
This commit is contained in:
Rusty Russell
2022-06-20 19:52:09 +09:30
parent f117225436
commit fccb11a641
4 changed files with 10 additions and 6 deletions

View File

@@ -345,9 +345,13 @@ static struct command_result *handle_invreq_response(struct command *cmd,
*/
/* We always tell them this unless it's trivial to calc and
* exactly as expected. */
if (!expected_amount || *inv->amount != *expected_amount)
json_add_amount_msat_only(out, "msat",
if (!expected_amount || *inv->amount != *expected_amount) {
if (deprecated_apis)
json_add_amount_msat_only(out, "msat",
amount_msat(*inv->amount));
json_add_amount_msat_only(out, "amount_msat",
amount_msat(*inv->amount));
}
json_object_end(out);
/* We tell them about next period at this point, if any. */