routerrpc: mark QueryProbability deprecated

We deprecate `QueryProbability`, as it displays the same information as
`QueryMissionControl` less the probability. `QueryRoutes` still contains
the total probability of a route.
This commit is contained in:
bitromortac
2022-11-24 16:17:04 +01:00
parent 1dd7a37d4d
commit 2d7fda2a41
7 changed files with 57 additions and 51 deletions

View File

@@ -692,47 +692,6 @@ func getMsatPairValue(msatValue lnwire.MilliSatoshi,
satValue)
}
// QueryProbability returns the current success probability estimate for a
// given node pair and amount.
func (s *Server) QueryProbability(ctx context.Context,
req *QueryProbabilityRequest) (*QueryProbabilityResponse, error) {
fromNode, err := route.NewVertexFromBytes(req.FromNode)
if err != nil {
return nil, err
}
toNode, err := route.NewVertexFromBytes(req.ToNode)
if err != nil {
return nil, err
}
amt := lnwire.MilliSatoshi(req.AmtMsat)
// Compute the probability.
var prob float64
mc := s.cfg.RouterBackend.MissionControl
capacity, err := s.cfg.RouterBackend.FetchAmountPairCapacity(
fromNode, toNode, amt,
)
// If we cannot query the capacity this means that either we don't have
// information available or that the channel fails min/maxHtlc
// constraints, so we return a zero probability.
if err != nil {
log.Errorf("Cannot fetch capacity: %v", err)
} else {
prob = mc.GetProbability(fromNode, toNode, amt, capacity)
}
history := mc.GetPairHistorySnapshot(fromNode, toNode)
return &QueryProbabilityResponse{
Probability: prob,
History: toRPCPairData(&history),
}, nil
}
// TrackPaymentV2 returns a stream of payment state updates. The stream is
// closed when the payment completes.
func (s *Server) TrackPaymentV2(request *TrackPaymentRequest,