mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
routerrpc: add log line for probing the invoice request
This commit is contained in:
@@ -558,6 +558,9 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
|
|||||||
// payment won't be blocked along the route to the destination. We send
|
// payment won't be blocked along the route to the destination. We send
|
||||||
// a probe payment with unmodified route hints.
|
// a probe payment with unmodified route hints.
|
||||||
if !isLSP(hints, s.cfg.RouterBackend.FetchChannelEndpoints) {
|
if !isLSP(hints, s.cfg.RouterBackend.FetchChannelEndpoints) {
|
||||||
|
log.Infof("No LSP detected, probing destination %x",
|
||||||
|
probeRequest.Dest)
|
||||||
|
|
||||||
probeRequest.RouteHints = invoicesrpc.CreateRPCRouteHints(hints)
|
probeRequest.RouteHints = invoicesrpc.CreateRPCRouteHints(hints)
|
||||||
return s.sendProbePayment(ctx, probeRequest)
|
return s.sendProbePayment(ctx, probeRequest)
|
||||||
}
|
}
|
||||||
@@ -571,9 +574,14 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the destination to the LSP node ID.
|
||||||
|
lspDest := lspHint.NodeID.SerializeCompressed()
|
||||||
|
probeRequest.Dest = lspDest
|
||||||
|
|
||||||
|
log.Infof("LSP detected, probing LSP with destination: %x", lspDest)
|
||||||
|
|
||||||
// The adjusted route hints serve the payment probe to find the last
|
// The adjusted route hints serve the payment probe to find the last
|
||||||
// public hop to the LSP on the route.
|
// public hop to the LSP on the route.
|
||||||
probeRequest.Dest = lspHint.NodeID.SerializeCompressed()
|
|
||||||
if len(lspAdjustedRouteHints) > 0 {
|
if len(lspAdjustedRouteHints) > 0 {
|
||||||
probeRequest.RouteHints = invoicesrpc.CreateRPCRouteHints(
|
probeRequest.RouteHints = invoicesrpc.CreateRPCRouteHints(
|
||||||
lspAdjustedRouteHints,
|
lspAdjustedRouteHints,
|
||||||
@@ -609,7 +617,8 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
|
|||||||
// Dispatch the payment probe with adjusted fee amount.
|
// Dispatch the payment probe with adjusted fee amount.
|
||||||
resp, err := s.sendProbePayment(ctx, probeRequest)
|
resp, err := s.sendProbePayment(ctx, probeRequest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("failed to send probe payment to "+
|
||||||
|
"LSP with destination %x: %w", lspDest, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the payment probe failed we only return the failure reason and
|
// If the payment probe failed we only return the failure reason and
|
||||||
|
|||||||
Reference in New Issue
Block a user