lnrpc/routerrpc: create mission control interface
This commit is contained in:
parent
34b264a3d8
commit
7f4c42847c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user