diff --git a/backend/mpc-system/services/session-coordinator/domain/entities/mpc_session.go b/backend/mpc-system/services/session-coordinator/domain/entities/mpc_session.go index 53068314..9b0b06c7 100644 --- a/backend/mpc-system/services/session-coordinator/domain/entities/mpc_session.go +++ b/backend/mpc-system/services/session-coordinator/domain/entities/mpc_session.go @@ -140,7 +140,15 @@ func (s *MPCSession) UpdateParticipantStatus(partyID value_objects.PartyID, stat // CanStart checks if all participants have joined and the session can start func (s *MPCSession) CanStart() bool { - if len(s.Participants) != s.Threshold.N() { + // Determine required participant count based on session type + // For keygen: all N parties must participate + // For sign: only T parties participate + requiredCount := s.Threshold.N() + if s.SessionType == SessionTypeSign { + requiredCount = s.Threshold.T() + } + + if len(s.Participants) != requiredCount { return false } @@ -151,7 +159,7 @@ func (s *MPCSession) CanStart() bool { readyCount++ } } - return readyCount == s.Threshold.N() + return readyCount == requiredCount } // Start transitions the session to in_progress