diff --git a/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go b/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go index cef97a68..c3c926b4 100644 --- a/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go +++ b/backend/mpc-system/services/server-party-co-managed/cmd/server/main.go @@ -416,11 +416,13 @@ func createCoManagedSessionEventHandler( zap.String("session_id", event.SessionId), zap.String("party_id", partyID)) - // Build SessionInfo from pending session and event data + // Build SessionInfo from session_started event (NOT from pendingSession cache) + // session_started event contains ALL participants who have joined, + // including external parties that joined dynamically after session_created // Note: We already called JoinSession in session_created phase, // so we use ExecuteWithSessionInfo to skip the duplicate JoinSession call - participants := make([]use_cases.ParticipantInfo, len(pendingSession.SelectedParties)) - for i, p := range pendingSession.SelectedParties { + participants := make([]use_cases.ParticipantInfo, len(event.SelectedParties)) + for i, p := range event.SelectedParties { participants[i] = use_cases.ParticipantInfo{ PartyID: p, PartyIndex: i, @@ -430,8 +432,8 @@ func createCoManagedSessionEventHandler( sessionInfo := &use_cases.SessionInfo{ SessionID: pendingSession.SessionID, SessionType: "co_managed_keygen", - ThresholdN: pendingSession.ThresholdN, - ThresholdT: pendingSession.ThresholdT, + ThresholdN: int(event.ThresholdN), + ThresholdT: int(event.ThresholdT), MessageHash: pendingSession.MessageHash, Participants: participants, }