close: activate notifications even with deprecated-apis.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: `close` now always returns notifications on delays.
This commit is contained in:
Rusty Russell 2021-04-06 13:34:25 +09:30
parent 3c5ea7fd8e
commit 162ba9d162
3 changed files with 8 additions and 11 deletions

7
doc/lightning-close.7 generated
View File

@ -78,9 +78,8 @@ closed if the peer reconnected\.
.SH NOTIFICATIONS
If \fBallow-deprecated-apis\fR is false, notifications may be returned
indicating what is going on, especially if the peer is offline and we
are waiting\. This will be enabled by default in future!
Notifications may be returned indicating what is going on, especially
if the peer is offline and we are waiting\.
.SH RETURN VALUE
@ -111,4 +110,4 @@ ZmnSCPxj \fI<ZmnSCPxj@protonmail.com\fR> is mainly responsible\.
Main web site: \fIhttps://github.com/ElementsProject/lightning\fR
\" SHA256STAMP:f835c6a11e0df5610761e858e78783f9f99d530b8d2a6bedaf6f301eccdc31e0
\" SHA256STAMP:c8a4fe414eeb72880346601be2e73f1ad6decb31b4d4e291549d8b339e47b68d

View File

@ -68,9 +68,8 @@ closed if the peer reconnected.
NOTIFICATIONS
-------------
If `allow-deprecated-apis` is false, notifications may be returned
indicating what is going on, especially if the peer is offline and we
are waiting. This will be enabled by default in future!
Notifications may be returned indicating what is going on, especially
if the peer is offline and we are waiting.
RETURN VALUE
------------

View File

@ -287,7 +287,6 @@ close_command_timeout(struct close_command *cc)
/* This will trigger drop_to_chain, which will trigger
* resolution of the command and destruction of the
* close_command. */
if (!deprecated_apis)
json_notify_fmt(cc->cmd, LOG_INFORM,
"Timed out, forcing close.");
channel_fail_permanent(cc->channel, REASON_USER,
@ -313,7 +312,7 @@ register_close_command(struct lightningd *ld,
&destroy_close_command_on_channel_destroy,
cc);
if (!deprecated_apis && !channel->owner) {
if (!channel->owner) {
char *msg = tal_strdup(tmpctx, "peer is offline, will negotiate once they reconnect");
if (timeout)
tal_append_fmt(&msg, " (%u seconds before unilateral close)",