mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
htlcswitch: return local add failure to caller
Fixes a pre-existing issue where nil was returned when a failure had occurred during commiting of the circuit.
This commit is contained in:
parent
c325bf8c57
commit
e00840e2ab
1 changed files with 5 additions and 1 deletions
|
@ -67,6 +67,10 @@ var (
|
||||||
// ErrUnreadableFailureMessage is returned when the failure message
|
// ErrUnreadableFailureMessage is returned when the failure message
|
||||||
// cannot be decrypted.
|
// cannot be decrypted.
|
||||||
ErrUnreadableFailureMessage = errors.New("unreadable failure message")
|
ErrUnreadableFailureMessage = errors.New("unreadable failure message")
|
||||||
|
|
||||||
|
// ErrLocalAddFailed signals that the ADD htlc for a local payment
|
||||||
|
// failed to be processed.
|
||||||
|
ErrLocalAddFailed = errors.New("local add HTLC failed")
|
||||||
)
|
)
|
||||||
|
|
||||||
// plexPacket encapsulates switch packet and adds error channel to receive
|
// plexPacket encapsulates switch packet and adds error channel to receive
|
||||||
|
@ -464,7 +468,7 @@ func (s *Switch) SendHTLC(firstHop lnwire.ShortChannelID, paymentID uint64,
|
||||||
return ErrDuplicateAdd
|
return ErrDuplicateAdd
|
||||||
|
|
||||||
case len(actions.Fails) == 1:
|
case len(actions.Fails) == 1:
|
||||||
return err
|
return ErrLocalAddFailed
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send packet to link.
|
// Send packet to link.
|
||||||
|
|
Loading…
Add table
Reference in a new issue