From 6de21b2a02c0a03f0b3e19a5f9c64d59a0f83d38 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Fri, 5 Jan 2024 22:18:25 +0800 Subject: [PATCH] routerrpc: add verbose log and ignore context canceled error --- lnrpc/routerrpc/router_server.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go index a294c999f..fd3f5e6cf 100644 --- a/lnrpc/routerrpc/router_server.go +++ b/lnrpc/routerrpc/router_server.go @@ -872,10 +872,17 @@ func (s *Server) trackPayment(subscription routing.ControlTowerSubscriber, stream.Context(), subscription, noInflightUpdates, stream.Send, ) + // If the context is canceled, we don't return an error. if errors.Is(err, context.Canceled) { - log.Debugf("Payment stream %v canceled", identifier) + log.Infof("Payment stream %v canceled", identifier) + + return nil } + // Otherwise, we will log and return the error as the stream has + // received an error from the payment lifecycle. + log.Errorf("TrackPayment got error for payment %x: %v", identifier, err) + return err }