common: disallow NULL channel_id to peer_failed_err.

No more sending "all-channel" errors; in particular, gossipd now only
sends warnings (which make us hang up), not errors, and peer_connected
rejections are warnings (and disconnect), not errors.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: Plugins: `peer_connected` rejections now send a warning, not an error, to the peer.
This commit is contained in:
Rusty Russell
2021-02-03 13:21:41 +10:30
parent f4ee41a989
commit 6b11cc8b8c
25 changed files with 220 additions and 216 deletions

View File

@@ -12,25 +12,25 @@ struct channel_id;
* towire_errorfmt - helper to turn string into WIRE_ERROR.
*
* @ctx: context to allocate from
* @channel: specific channel to complain about, or NULL for all.
* @channel: specific channel to complain about
* @fmt: format for error.
*/
u8 *towire_errorfmt(const tal_t *ctx,
const struct channel_id *channel,
const char *fmt, ...) PRINTF_FMT(3,4);
const char *fmt, ...) PRINTF_FMT(3,4) NON_NULL_ARGS(2);
/**
* towire_errorfmtv - helper to turn string into WIRE_ERROR.
*
* @ctx: context to allocate from
* @channel: specific channel to complain about, or NULL for all.
* @channel: specific channel to complain about
* @fmt: format for error.
* @ap: accumulated varargs.
*/
u8 *towire_errorfmtv(const tal_t *ctx,
const struct channel_id *channel,
const char *fmt,
va_list ap);
va_list ap) NON_NULL_ARGS(2);
/**
* towire_warningfmt - helper to turn string into WIRE_WARNING.