rwadurian/backend/mpc-system/services/service-party-android/app
hailin dbeef9f415 fix(android): 修正2-of-3服务器备份参与方选择逻辑
问题描述:
之前的实现在勾选"包含服务器备份"时,会选择全部3个参与方
(2个用户设备 + 1个服务器),导致后端报错:
"need exactly 2 parties for threshold 2, got 3"

根本原因:
buildSigningParticipantList() 方法在 includeServerParties=true 时,
返回了所有参与方,没有排除丢失的设备。

修复内容:
1. buildSigningParticipantList() 新增 currentPartyId 参数
2. includeServerBackup=true 时的新逻辑:
   - 只选择当前设备 (currentPartyId)
   - 加上服务器方 (co-managed-party-*)
   - 排除另一个丢失的用户设备
   - 总共正好 2 个参与方,满足 threshold t=2
3. 增强调试日志:
   - [PARTICIPANT-LIST] Device lost mode
   - Selected X parties for signing

测试场景:
- 不勾选:2个用户设备参与(默认行为)
- 勾选:1个当前设备 + 1个服务器 = 2方(设备丢失场景)

修改文件:
- TssRepository.kt (lines 3719-3744, 3796-3804)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-26 18:11:17 -08:00
..
libs feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00
src/main fix(android): 修正2-of-3服务器备份参与方选择逻辑 2026-01-26 18:11:17 -08:00
build.gradle.kts fix(tss): 修复备份恢复后签名失败的问题 2026-01-20 00:39:05 -08:00
proguard-rules.pro feat(android): add Android TSS Party app with full API implementation 2025-12-31 23:27:29 -08:00