diff --git a/CHANGELOG.md b/CHANGELOG.md index a080ecdb9..939d91cf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- JSON API: `invoice` expiry defaults to 7 days. + ### Deprecated Note: You should always set `allow-deprecated-apis=false` to test for diff --git a/doc/lightning-invoice.7 b/doc/lightning-invoice.7 index 79aef8a96..02f0beb31 100644 --- a/doc/lightning-invoice.7 +++ b/doc/lightning-invoice.7 @@ -2,12 +2,12 @@ .\" Title: lightning-invoice .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 02/23/2019 +.\" Date: 04/10/2019 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "LIGHTNING\-INVOICE" "7" "02/23/2019" "\ \&" "\ \&" +.TH "LIGHTNING\-INVOICE" "7" "04/10/2019" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,7 +42,7 @@ The \fIlabel\fR must be a unique string or number (which is treated as a string, .sp The \fIdescription\fR is a short description of purpose of payment, e\&.g\&. \fI1 cup of coffee\fR\&. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to\&. It must be UTF\-8, and cannot use \fI\eu\fR JSON escape codes\&. .sp -The \fIexpiry\fR is optionally the number of seconds the invoice is valid for\&. If no value is provided the default of 3600 (1 Hour) is used\&. +The \fIexpiry\fR is optionally the number of seconds the invoice is valid for\&. If no value is provided the default of 604800 (1 week) is used\&. .sp The \fIfallbacks\fR array is one or more fallback addresses to include in the invoice (in order from most\-preferred to least): note that these arrays are not currently tracked to fulfill the invoice\&. .sp diff --git a/doc/lightning-invoice.7.txt b/doc/lightning-invoice.7.txt index 7b597a299..0ea947d38 100644 --- a/doc/lightning-invoice.7.txt +++ b/doc/lightning-invoice.7.txt @@ -35,7 +35,7 @@ and is viewable by any node you send this invoice to. It must be UTF-8, and cannot use '\u' JSON escape codes. The 'expiry' is optionally the number of seconds the invoice is valid for. -If no value is provided the default of 3600 (1 Hour) is used. +If no value is provided the default of 604800 (1 week) is used. The 'fallbacks' array is one or more fallback addresses to include in the invoice (in order from most-preferred to least): note that these diff --git a/lightningd/invoice.c b/lightningd/invoice.c index ed21be067..80e294a29 100644 --- a/lightningd/invoice.c +++ b/lightningd/invoice.c @@ -415,7 +415,7 @@ static struct command_result *json_invoice(struct command *cmd, p_req("msatoshi", param_msat_or_any, &msatoshi_val), p_req("label", param_label, &info->label), p_req("description", param_escaped_string, &desc_val), - p_opt_def("expiry", param_u64, &expiry, 3600), + p_opt_def("expiry", param_u64, &expiry, 3600*24*7), p_opt("fallbacks", param_array, &fallbacks), p_opt("preimage", param_tok, &preimagetok), p_opt("exposeprivatechannels", param_bool, &exposeprivate),