lnrpc/routerrpc: create mission control interface

This commit is contained in:
Joost Jager 2019-07-05 09:34:45 +02:00
parent 34b264a3d8
commit 7f4c42847c
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -42,7 +42,7 @@ type RouterBackend struct {
amt lnwire.MilliSatoshi, restrictions *routing.RestrictParams,
finalExpiry ...uint16) (*route.Route, error)
MissionControl *routing.MissionControl
MissionControl MissionControl
// ActiveNetParams are the network parameters of the primary network
// that the route is operating on. This is necessary so we can ensure
@ -55,6 +55,22 @@ type RouterBackend struct {
Tower routing.ControlTower
}
// MissionControl defines the mission control dependencies of routerrpc.
type MissionControl interface {
// GetEdgeProbability is expected to return the success probability of a payment
// from fromNode along edge.
GetEdgeProbability(fromNode route.Vertex,
edge routing.EdgeLocator, amt lnwire.MilliSatoshi) float64
// ResetHistory resets the history of MissionControl returning it to a state as
// if no payment attempts have been made.
ResetHistory()
// GetHistorySnapshot takes a snapshot from the current mission control state
// and actual probability estimates.
GetHistorySnapshot() *routing.MissionControlSnapshot
}
// QueryRoutes attempts to query the daemons' Channel Router for a possible
// route to a target destination capable of carrying a specific amount of
// satoshis within the route's flow. The retuned route contains the full