diff --git a/tss/coordinator.go b/tss/coordinator.go index 64ea6eb8..444722e7 100644 --- a/tss/coordinator.go +++ b/tss/coordinator.go @@ -88,6 +88,7 @@ func (c *Coordinator) Execute(ctx context.Context, tssProcess TssProcess, result c.processLock.Lock() c.pendingProcesses[sessionID] = false c.processLock.Unlock() + tssProcess.Stop() }() coordinatorElector := c.electorFactory.CoordinatorElector(sessionID, elector.Static) @@ -111,7 +112,6 @@ func (c *Coordinator) Execute(ctx context.Context, tssProcess TssProcess, result } if !tssProcess.Retryable() { - tssProcess.Stop() return err } diff --git a/tss/keygen/keygen.go b/tss/keygen/keygen.go index 89eb35ed..982ca9b1 100644 --- a/tss/keygen/keygen.go +++ b/tss/keygen/keygen.go @@ -91,7 +91,6 @@ func (k *Keygen) Run( k.Log.Info().Msgf("Started keygen process") - defer k.Stop() p := pool.New().WithContext(ctx).WithCancelOnError() p.Go(func(ctx context.Context) error { return k.ProcessOutboundMessages(ctx, outChn, comm.TssKeyGenMsg) }) p.Go(func(ctx context.Context) error { return k.ProcessInboundMessages(ctx, msgChn) }) diff --git a/tss/resharing/resharing.go b/tss/resharing/resharing.go index 3a8a69d4..148e6add 100644 --- a/tss/resharing/resharing.go +++ b/tss/resharing/resharing.go @@ -118,7 +118,6 @@ func (r *Resharing) Run( return err } - defer r.Stop() p := pool.New().WithContext(ctx).WithCancelOnError() p.Go(func(ctx context.Context) error { return r.ProcessOutboundMessages(ctx, outChn, comm.TssReshareMsg) }) p.Go(func(ctx context.Context) error { return r.ProcessInboundMessages(ctx, msgChn) }) diff --git a/tss/signing/signing.go b/tss/signing/signing.go index 62bbd8a5..00b5e4cd 100644 --- a/tss/signing/signing.go +++ b/tss/signing/signing.go @@ -119,7 +119,6 @@ func (s *Signing) Run( msgChn := make(chan *comm.WrappedMessage) s.subscriptionID = s.Communication.Subscribe(s.SessionID(), comm.TssKeySignMsg, msgChn) - defer s.Stop() p := pool.New().WithContext(ctx).WithCancelOnError() p.Go(func(ctx context.Context) error { return s.ProcessOutboundMessages(ctx, outChn, comm.TssKeySignMsg) }) p.Go(func(ctx context.Context) error { return s.ProcessInboundMessages(ctx, msgChn) })