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
@ -898,6 +898,18 @@ func (s *Switch) handleLocalResponse(pkt *htlcPacket) {
|
|||||||
pkt.inKey(), err)
|
pkt.inKey(), err)
|
||||||
return
|
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
|
// extractResult uses the given deobfuscator to extract the payment result from
|
||||||
|
Loading…
Reference in New Issue
Block a user