Skip to content

Commit fd7f6ca

Browse files
committed
routerrpc: add log line for probing the invoice request
1 parent 6b80796 commit fd7f6ca

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lnrpc/routerrpc/router_server.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
558558
// payment won't be blocked along the route to the destination. We send
559559
// a probe payment with unmodified route hints.
560560
if !isLSP(hints, s.cfg.RouterBackend.FetchChannelEndpoints) {
561+
log.Infof("No LSP detected, probing destination %x",
562+
probeRequest.Dest)
563+
561564
probeRequest.RouteHints = invoicesrpc.CreateRPCRouteHints(hints)
562565
return s.sendProbePayment(ctx, probeRequest)
563566
}
@@ -571,9 +574,14 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
571574
return nil, err
572575
}
573576

577+
// Set the destination to the LSP node ID.
578+
lspDest := lspHint.NodeID.SerializeCompressed()
579+
probeRequest.Dest = lspDest
580+
581+
log.Infof("LSP detected, probing LSP with destination: %x", lspDest)
582+
574583
// The adjusted route hints serve the payment probe to find the last
575584
// public hop to the LSP on the route.
576-
probeRequest.Dest = lspHint.NodeID.SerializeCompressed()
577585
if len(lspAdjustedRouteHints) > 0 {
578586
probeRequest.RouteHints = invoicesrpc.CreateRPCRouteHints(
579587
lspAdjustedRouteHints,
@@ -609,7 +617,8 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
609617
// Dispatch the payment probe with adjusted fee amount.
610618
resp, err := s.sendProbePayment(ctx, probeRequest)
611619
if err != nil {
612-
return nil, err
620+
return nil, fmt.Errorf("failed to send probe payment to "+
621+
"LSP with destination %x: %w", lspDest, err)
613622
}
614623

615624
// If the payment probe failed we only return the failure reason and

0 commit comments

Comments
 (0)