Skip to content

Commit

Permalink
this goroutine doesn't need to be part of the errgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Jan 24, 2025
1 parent 498b9b3 commit 1033335
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spv/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,15 +428,13 @@ func (s *Syncer) Run(ctx context.Context) (err error) {
// Ensure wallet.Run cleanly finishes/is canceled first when outer
// context is canceled.
walletCtx, walletCtxCancel := context.WithCancel(context.Background())
g.Go(func() error {
go func() {
select {
case <-ctx.Done():
case <-gctx.Done():
}
walletCtxCancel()
// Do not cancel gctx yet; wait for wallet.Run to return.
return nil
})
}()
g.Go(func() error {
// Run wallet background goroutines (currently, this just runs
// mixclient).
Expand Down

0 comments on commit 1033335

Please sign in to comment.