mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-29 20:33:04 +02:00
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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user