From 4cc5428087468bd929ced631962f0498e22ca89a Mon Sep 17 00:00:00 2001 From: ziggie Date: Tue, 21 Oct 2025 11:46:35 +0200 Subject: [PATCH] routing: add context to reloadPayment method --- routing/payment_lifecycle.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/routing/payment_lifecycle.go b/routing/payment_lifecycle.go index 763cf43ab..9be86dc1b 100644 --- a/routing/payment_lifecycle.go +++ b/routing/payment_lifecycle.go @@ -250,7 +250,7 @@ lifecycle: } // We update the payment state on every iteration. - currentPayment, ps, err := p.reloadPayment() + currentPayment, ps, err := p.reloadPayment(cleanupCtx) if err != nil { return exitWithErr(err) } @@ -1163,11 +1163,10 @@ func (p *paymentLifecycle) reloadInflightAttempts( } // reloadPayment returns the latest payment found in the db (control tower). -func (p *paymentLifecycle) reloadPayment() (paymentsdb.DBMPPayment, +func (p *paymentLifecycle) reloadPayment( + ctx context.Context) (paymentsdb.DBMPPayment, *paymentsdb.MPPaymentState, error) { - ctx := context.TODO() - // Read the db to get the latest state of the payment. payment, err := p.router.cfg.Control.FetchPayment(ctx, p.identifier) if err != nil {