mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
routerrpc: add mc probability query rpc
Probabilities are no longer returned for querymc calls. To still provide some insight into the mission control internals, this commit adds a new rpc that calculates a success probability estimate for a specific node pair and amount.
This commit is contained in:
@@ -355,6 +355,26 @@ func (m *MissionControl) GetHistorySnapshot() *MissionControlSnapshot {
|
||||
return &snapshot
|
||||
}
|
||||
|
||||
// GetPairHistorySnapshot returns the stored history for a given node pair.
|
||||
func (m *MissionControl) GetPairHistorySnapshot(
|
||||
fromNode, toNode route.Vertex) TimedPairResult {
|
||||
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
results, ok := m.lastPairResult[fromNode]
|
||||
if !ok {
|
||||
return TimedPairResult{}
|
||||
}
|
||||
|
||||
result, ok := results[toNode]
|
||||
if !ok {
|
||||
return TimedPairResult{}
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// ReportPaymentFail reports a failed payment to mission control as input for
|
||||
// future probability estimates. The failureSourceIdx argument indicates the
|
||||
// failure source. If it is nil, the failure source is unknown. This function
|
||||
|
Reference in New Issue
Block a user