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

@@ -43,10 +43,10 @@ u8 *towire_errorfmtv(const tal_t *ctx,
bool channel_id_is_all(const struct channel_id *channel_id);
/**
* sanitize_error - extract and sanitize contents of WIRE_ERROR.
* sanitize_error - extract and sanitize contents of WIRE_ERROR/WIRE_WARNING.
*
* @ctx: context to allocate from
* @errmsg: the wire_error
* @errmsg: the wire_error or wire_warning
* @channel: (out) channel it's referring to, or NULL if don't care.
*/
char *sanitize_error(const tal_t *ctx, const u8 *errmsg,