routerrpc+htlcswitch: move intercepted htlc tracking to switch
In this commit we move the tracking of the outstanding intercepted htlcs to InterceptableSwitch. This is a preparation for making the htlc interceptor required. Required interception involves tracking outstanding htlcs across multiple grpc client sessions. The per-session routerrpc forwardInterceptor object is therefore no longer the best place for that.
This commit is contained in:
6 files changed
+379
-207
No files matched your search
@@ -234,6 +234,9 @@ type TowerClient interface {
|
||||
type InterceptableHtlcForwarder interface {
|
||||
// SetInterceptor sets a ForwardInterceptor.
|
||||
SetInterceptor(interceptor ForwardInterceptor)
|
||||
|
||||
// Resolve resolves an intercepted packet.
|
||||
Resolve(res *FwdResolution) error
|
||||
}
|
||||
|
||||
// ForwardInterceptor is a function that is invoked from the switch for every
|
||||
@@ -242,7 +245,7 @@ type InterceptableHtlcForwarder interface {
|
||||
// to resolve it manually later in case it is held.
|
||||
// The return value indicates if this handler will take control of this forward
|
||||
// and resolve it later or let the switch execute its default behavior.
|
||||
type ForwardInterceptor func(InterceptedForward) bool
|
||||
type ForwardInterceptor func(InterceptedPacket) error
|
||||
|
||||
// InterceptedPacket contains the relevant information for the interceptor about
|
||||
// an htlc.
|
||||
|
||||
Reference in new issue
Block a user