Skip to content

Commit a4a2bfb

Browse files
committed
sweepbatcher: use WithoutCancel for notifications
1 parent bb837a4 commit a4a2bfb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sweepbatcher/sweep_batch.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,13 @@ func (b *batch) handleSpend(ctx context.Context, spendTx *wire.MsgTx) error {
18871887

18881888
// Dispatch the sweep notifier, we don't care about the outcome
18891889
// of this action so we don't wait for it.
1890-
go sweep.notifySweepSpend(ctx, &spendDetail)
1890+
go func() {
1891+
// Make sure this context doesn't expire so we
1892+
// successfully notify the caller.
1893+
ctx := context.WithoutCancel(ctx)
1894+
1895+
sweep.notifySweepSpend(ctx, &spendDetail)
1896+
}()
18911897
}
18921898

18931899
// Proceed with purging the sweeps. This will feed the sweeps that

0 commit comments

Comments
 (0)