htlcswitch: send a direct Error if we get a known channel error on validate commit
This commit is contained in:
parent
1c5d62a804
commit
b3bc374ba1
@ -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()),
|
||||
|
Loading…
Reference in New Issue
Block a user