lightningd: implement receiving warnings.

This takes from the draft spec at https://github.com/lightningnetwork/lightning-rfc/pull/834

Note that if this draft does not get included, the peer will simply
ignore the warning message (we always close the connection afterwards
anyway).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: we now report the new (draft) warning message.
This commit is contained in:
Rusty Russell
2021-02-02 23:16:01 +10:30
parent f0659d0ab0
commit a7c5a1f1d2
12 changed files with 55 additions and 20 deletions

View File

@@ -49,7 +49,7 @@ void peer_failed(struct per_peer_state *pps,
peer_fatal_continue(take(msg), pps);
}
/* We're failing because peer sent us an error message */
/* We're failing because peer sent us an error/warning message */
void peer_failed_received_errmsg(struct per_peer_state *pps,
const char *desc,
const struct channel_id *channel_id,
@@ -62,7 +62,7 @@ void peer_failed_received_errmsg(struct per_peer_state *pps,
channel_id = &all_channels;
msg = towire_status_peer_error(NULL, channel_id, desc, soft_error, pps,
NULL);
peer_billboard(true, "Received error from peer: %s", desc);
peer_billboard(true, "Received %s", desc);
peer_fatal_continue(take(msg), pps);
}