core-lightning/common/peer_failed.h
Rusty Russell 38d2899fbb common/per_per_state: generalize lightningd/peer_comm Part 1
Encapsulating the peer state was a win for lightningd; not surprisingly,
it's even more of a win for the other daemons, especially as we want
to add a little gossip information.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-06-04 01:29:39 +00:00

31 lines
898 B
C

#ifndef LIGHTNING_COMMON_PEER_FAILED_H
#define LIGHTNING_COMMON_PEER_FAILED_H
#include "config.h"
#include <ccan/compiler/compiler.h>
#include <ccan/short_types/short_types.h>
struct channel_id;
struct per_peer_state;
/**
* peer_failed - Exit with error for peer.
* @pps: the per-peer state.
* @channel_id: channel with error, or NULL for all.
* @fmt...: format as per status_failed(STATUS_FAIL_PEER_BAD)
*/
void peer_failed(struct per_peer_state *pps,
const struct channel_id *channel_id,
const char *fmt, ...)
PRINTF_FMT(3,4) NORETURN;
/* We're failing because peer sent us an error message: NULL
* channel_id means all channels. */
void peer_failed_received_errmsg(struct per_peer_state *pps,
const char *desc,
const struct channel_id *channel_id) NORETURN;
/* I/O error */
void peer_failed_connection_lost(void) NORETURN;
#endif /* LIGHTNING_COMMON_PEER_FAILED_H */