mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
channeld: treat all incoming errors as "soft", so we retry.
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>
This commit is contained in:
committed by
Christian Decker
parent
839909d2cf
commit
1d0c433dc4
@@ -52,25 +52,15 @@ void peer_failed(struct per_peer_state *pps,
|
||||
/* We're failing because peer sent us an error message */
|
||||
void peer_failed_received_errmsg(struct per_peer_state *pps,
|
||||
const char *desc,
|
||||
const struct channel_id *channel_id)
|
||||
const struct channel_id *channel_id,
|
||||
bool soft_error)
|
||||
{
|
||||
static const struct channel_id all_channels;
|
||||
u8 *msg;
|
||||
bool sync_error;
|
||||
|
||||
/* <+roasbeef> rusty: sync error can just be a timing thing
|
||||
* <+roasbeef> andn doesn't always mean that we can't continue forwrd,
|
||||
* or y'all sent the wrong info
|
||||
*/
|
||||
/* So while LND is sitting in the corner eating paint, back off. */
|
||||
sync_error = strstr(desc, "sync error");
|
||||
if (sync_error)
|
||||
status_unusual("Peer said '%s' so we'll come back later",
|
||||
desc);
|
||||
|
||||
if (!channel_id)
|
||||
channel_id = &all_channels;
|
||||
msg = towire_status_peer_error(NULL, channel_id, desc, sync_error, pps,
|
||||
msg = towire_status_peer_error(NULL, channel_id, desc, soft_error, pps,
|
||||
NULL);
|
||||
peer_billboard(true, "Received error from peer: %s", desc);
|
||||
peer_fatal_continue(take(msg), pps);
|
||||
|
||||
Reference in New Issue
Block a user