htlcswitch: send a direct Error if we get a known channel error on validate commit

This commit is contained in:
Olaoluwa Osuntokun 2018-04-04 17:41:40 -07:00
parent 1c5d62a804
commit b3bc374ba1
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -1240,7 +1240,14 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
// direct error.
//
// TODO(roasbeef): force close chan
if _, ok := err.(*lnwallet.InvalidCommitSigError); ok {
var sendErr bool
switch err.(type) {
case *lnwallet.InvalidCommitSigError:
sendErr = true
case *lnwallet.InvalidHtlcSigError:
sendErr = true
}
if sendErr {
err := l.cfg.Peer.SendMessage(&lnwire.Error{
ChanID: l.ChanID(),
Data: []byte(err.Error()),