Browse Source

json_invoice: return absolute expiry_time

Requested-by: Nadav Ivgi <nadav@shesek.info>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
18db1105c7
  1. 3
      lightningd/invoice.c

3
lightningd/invoice.c

@ -228,6 +228,7 @@ static void json_invoice(struct command *cmd,
json_object_start(response, NULL); json_object_start(response, NULL);
json_add_hex(response, "rhash", json_add_hex(response, "rhash",
&invoice->rhash, sizeof(invoice->rhash)); &invoice->rhash, sizeof(invoice->rhash));
json_add_u64(response, "expiry_time", invoice->expiry_time);
json_add_string(response, "bolt11", b11enc); json_add_string(response, "bolt11", b11enc);
if (b11->description_hash) if (b11->description_hash)
json_add_string(response, "description", b11->description); json_add_string(response, "description", b11->description);
@ -240,7 +241,7 @@ static const struct json_command invoice_command = {
"invoice", "invoice",
json_invoice, json_invoice,
"Create invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour)", "Create invoice for {msatoshi} with {label} and {description} with optional {expiry} seconds (default 1 hour)",
"Returns the {rhash} and {bolt11} on success, and {description} if too alrge for {bolt11}. " "Returns the {rhash}, {expiry_time} and {bolt11} on success, and {description} if too alrge for {bolt11}. "
}; };
AUTODATA(json_command, &invoice_command); AUTODATA(json_command, &invoice_command);

Loading…
Cancel
Save