From 9595800158caa8a6a6d152d935b215792ec3752b Mon Sep 17 00:00:00 2001 From: ciny Date: Tue, 27 Aug 2019 13:10:08 +0200 Subject: [PATCH] core: store correct backup type during recovery --- core/src/apps/management/recovery_device/homescreen.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/apps/management/recovery_device/homescreen.py b/core/src/apps/management/recovery_device/homescreen.py index 7eea09b4e8..3a7fc9bfc6 100644 --- a/core/src/apps/management/recovery_device/homescreen.py +++ b/core/src/apps/management/recovery_device/homescreen.py @@ -97,10 +97,16 @@ async def _finish_recovery_dry_run( async def _finish_recovery( ctx: wire.Context, secret: bytes, mnemonic_type: int ) -> Success: + group_count = storage.recovery.get_slip39_group_count() + if group_count and group_count > 1: + mnemonic_type = mnemonic.TYPE_SLIP39_GROUP storage.device.store_mnemonic_secret( secret, mnemonic_type, needs_backup=False, no_backup=False ) - if mnemonic_type == mnemonic.TYPE_SLIP39: + if ( + mnemonic_type == mnemonic.TYPE_SLIP39 + or mnemonic_type == mnemonic.TYPE_SLIP39_GROUP + ): identifier = storage.recovery.get_slip39_identifier() exponent = storage.recovery.get_slip39_iteration_exponent() if identifier is None or exponent is None: