mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-13 11:09:23 +01:00
htlcswitch: notify send forward failures and settles
Add notifications for local initiated sends settles and forwarding failures. As with link failures, local send settles and forwarding failures are reported directly to the router so must have their own notification handling.
This commit is contained in:
parent
79a890fa48
commit
22d370aa51
1 changed files with 12 additions and 0 deletions
|
@ -898,6 +898,18 @@ func (s *Switch) handleLocalResponse(pkt *htlcPacket) {
|
|||
pkt.inKey(), err)
|
||||
return
|
||||
}
|
||||
|
||||
// Finally, notify on the htlc failure or success that has been handled.
|
||||
key := newHtlcKey(pkt)
|
||||
eventType := getEventType(pkt)
|
||||
|
||||
switch pkt.htlc.(type) {
|
||||
case *lnwire.UpdateFulfillHTLC:
|
||||
s.cfg.HtlcNotifier.NotifySettleEvent(key, eventType)
|
||||
|
||||
case *lnwire.UpdateFailHTLC:
|
||||
s.cfg.HtlcNotifier.NotifyForwardingFailEvent(key, eventType)
|
||||
}
|
||||
}
|
||||
|
||||
// extractResult uses the given deobfuscator to extract the payment result from
|
||||
|
|
Loading…
Add table
Reference in a new issue