From a4a2bfbee3913f6c3f5f44c47dec837db5378ea1 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Wed, 30 Apr 2025 18:00:45 -0300 Subject: [PATCH] sweepbatcher: use WithoutCancel for notifications --- sweepbatcher/sweep_batch.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sweepbatcher/sweep_batch.go b/sweepbatcher/sweep_batch.go index 0d066138..c8a375a5 100644 --- a/sweepbatcher/sweep_batch.go +++ b/sweepbatcher/sweep_batch.go @@ -1887,7 +1887,13 @@ func (b *batch) handleSpend(ctx context.Context, spendTx *wire.MsgTx) error { // Dispatch the sweep notifier, we don't care about the outcome // of this action so we don't wait for it. - go sweep.notifySweepSpend(ctx, &spendDetail) + go func() { + // Make sure this context doesn't expire so we + // successfully notify the caller. + ctx := context.WithoutCancel(ctx) + + sweep.notifySweepSpend(ctx, &spendDetail) + }() } // Proceed with purging the sweeps. This will feed the sweeps that