htlcswitch/link: set PermanentFailure in case of remote error

This commit is contained in:
Johan T. Halseth 2018-10-08 15:46:14 +02:00
parent a97182b1e9
commit dde6763cef
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -1900,9 +1900,14 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
// Error received from remote, MUST fail channel, but should
// only print the contents of the error message if all
// characters are printable ASCII.
l.fail(LinkFailureError{code: ErrRemoteError},
l.fail(
LinkFailureError{
code: ErrRemoteError,
PermanentFailure: true,
},
"ChannelPoint(%v): received error from peer: %v",
l.channel.ChannelPoint(), msg.Error())
l.channel.ChannelPoint(), msg.Error(),
)
default:
l.log.Warnf("received unknown message of type %T", msg)
}