maybe fix logic for closing waitgroup in subMany()

This commit is contained in:
fiatjaf 2025-02-16 18:45:09 -03:00
parent 7412a6fb40
commit 00c22b0b77

View File

@ -312,7 +312,7 @@ func (pool *SimplePool) subMany(
close(events)
cancel(fmt.Errorf("aborted: %w", context.Cause(ctx)))
}
if !eosed.Load() {
if eosed.CompareAndSwap(false, true) {
eoseWg.Done()
}
}()