mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
1d0c433dc4
We still close the channel if we *send* an error, but we seem to have hit another case where LND sends an error which seems transient, so this will make a best-effort attempt to preserve our channel in that case. Some test have to be modified, since they don't terminate as they did previously :( Changelog-Changed: quirks: We'll now reconnect and retry if we get an error on an established channel. This works around lnd sending error messages that may be non-fatal. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
33 lines
921 B
C
33 lines
921 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,
|
|
bool soft_error)
|
|
NORETURN;
|
|
|
|
/* I/O error */
|
|
void peer_failed_connection_lost(void) NORETURN;
|
|
|
|
#endif /* LIGHTNING_COMMON_PEER_FAILED_H */
|