From 4cca23264d5ed0fcf51a1f6ba8ca80f1a96253bd Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 12 Dec 2017 11:42:34 -0800 Subject: [PATCH] htlcswitch: add new default case when handling UpdateFailMalformedHLTC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this commit, we modify the existing logic to handle UpdateFailMalformedHLTC message from an incoming peer. Rather than fail the Chanel if they give us an invalid failure code, we’ll instead treat it as a temporary channel failure so we can continue to forward the error. --- htlcswitch/link.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htlcswitch/link.go b/htlcswitch/link.go index e5a4c5d6..d038292e 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -859,10 +859,8 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) { OnionSHA256: msg.ShaOnionBlob, } default: - // TODO(roasbeef): fail channel here? - log.Errorf("unable to understand code of received " + - "malformed error") - return + log.Errorf("Unknown failure code: %v", msg.FailureCode) + failure = &lnwire.FailTemporaryChannelFailure{} } // With the error parsed, we'll convert the into it's opaque