diff --git a/backend/mpc-system/services/account/adapters/input/http/co_managed_handler.go b/backend/mpc-system/services/account/adapters/input/http/co_managed_handler.go index 819f0f13..6e19b4c6 100644 --- a/backend/mpc-system/services/account/adapters/input/http/co_managed_handler.go +++ b/backend/mpc-system/services/account/adapters/input/http/co_managed_handler.go @@ -691,7 +691,9 @@ func (h *CoManagedHTTPHandler) GetSignSessionByInviteCode(c *gin.Context) { SELECT id, COALESCE(wallet_name, ''), COALESCE(keygen_session_id::text, ''), threshold_n, threshold_t, status, expires_at, COALESCE(message_hash, '') FROM mpc_sessions - WHERE invite_code = $1 AND session_type = 'sign' + WHERE invite_code = $1 AND session_type = 'sign' AND status != 'failed' + ORDER BY created_at DESC + LIMIT 1 `, inviteCode).Scan(&sessionID, &walletName, &keygenSessionID, &thresholdN, &thresholdT, &status, &expiresAt, &messageHash) if err != nil {