mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
common: add peer_error flag to treat this error as "soft".
The spec says to close the channel if they send us an error, but we need to be more lenient to preserve channels with other implementations. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -390,6 +390,7 @@ void channel_errmsg(struct channel *channel,
|
||||
struct per_peer_state *pps,
|
||||
const struct channel_id *channel_id UNUSED,
|
||||
const char *desc,
|
||||
bool soft_error,
|
||||
const u8 *err_for_them)
|
||||
{
|
||||
notify_disconnect(channel->peer->ld, &channel->peer->id);
|
||||
@@ -407,6 +408,15 @@ void channel_errmsg(struct channel *channel,
|
||||
err_for_them,
|
||||
tal_count(err_for_them), 0);
|
||||
|
||||
/* Other implementations chose to ignore errors early on. Not
|
||||
* surprisingly, they now spew out spurious errors frequently,
|
||||
* and we would close the channel on them. */
|
||||
if (soft_error) {
|
||||
channel_fail_reconnect_later(channel, "%s: (ignoring) %s",
|
||||
channel->owner->name, desc);
|
||||
return;
|
||||
}
|
||||
|
||||
/* BOLT #1:
|
||||
*
|
||||
* A sending node:
|
||||
|
||||
Reference in New Issue
Block a user