rwadurian/backend/mpc-system/services/server-party-co-managed/cmd
hailin 3a985b443f fix(co-managed): 使用数据库中的 PartyIndex 而非循环索引
问题:
- server-party-co-managed 在构建参与者列表时使用循环索引 i
- 导致 PartyIndex 映射错误: map[0:0 1:1] (错误)
- 应为: map[0:0 2:1] (Android 的 keygen index 是 2, 不是 1)
- TSS 协议因索引错误失败: "failed to calculate Bob_mid or Bob_mid_wc"

根本原因:
- event.SelectedParties 只包含 party ID, 不包含 PartyIndex
- 使用循环索引是假设,不是来自数据库的实际数据

解决方案:
1. PendingSession 添加 Participants 字段
2. 存储 JoinSession 返回的 sessionInfo.Participants
   - JoinSession 从数据库查询并返回所有参与方的正确 PartyIndex
3. session_started 时直接使用存储的 participants
   - 不再从 event.SelectedParties 构建

关键变更:
- PendingSession.Participants: 保存来自数据库的正确索引
- 移除循环构建逻辑: 不再假设 PartyIndex = loop index
- 数据来源: 数据库 (JoinSession response) → 缓存 → 使用

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-26 20:24:32 -08:00
..
server fix(co-managed): 使用数据库中的 PartyIndex 而非循环索引 2026-01-26 20:24:32 -08:00