From 87cdf3b797949151232aeb7f83e051a7b60a8c93 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 23 Nov 2020 14:42:41 +0100 Subject: [PATCH] htlcswitch/link: revert borking channels on received Errors Since it turned out borking channels on every received error could cause us to bork channels in case of a sync error with C-lightning, we revert this for now. --- htlcswitch/link.go | 11 +++++++++-- htlcswitch/link_test.go | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/htlcswitch/link.go b/htlcswitch/link.go index f43bc3a4..70fff3db 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -1902,8 +1902,15 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) { // characters are printable ASCII. l.fail( LinkFailureError{ - code: ErrRemoteError, - PermanentFailure: true, + code: ErrRemoteError, + + // TODO(halseth): we currently don't fail the + // channel permanently, as there are some sync + // issues with other implementations that will + // lead to them sending an error message, but + // we can recover from on next connection. See + // https://github.com/ElementsProject/lightning/issues/4212 + PermanentFailure: false, }, "ChannelPoint(%v): received error from peer: %v", l.channel.ChannelPoint(), msg.Error(), diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index 970054ca..8671bd54 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -5273,7 +5273,9 @@ func TestChannelLinkFail(t *testing.T) { c.HandleChannelUpdate(err) }, false, - true, + // TODO(halseth) For compatibility with CL we currently + // don't treat Errors as permanent errors. + false, }, }