mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-17 01:52:02 +00:00
core/slip39: catch exception also when finding out threshold in recovery
This commit is contained in:
parent
6c50b155de
commit
390bef00ca
@ -70,7 +70,10 @@ async def recovery_device(ctx, msg):
|
|||||||
ctx, wordcount, mnemonic_module == mnemonic.slip39
|
ctx, wordcount, mnemonic_module == mnemonic.slip39
|
||||||
)
|
)
|
||||||
if mnemonic_threshold is None:
|
if mnemonic_threshold is None:
|
||||||
mnemonic_threshold = mnemonic_module.get_mnemonic_threshold(words)
|
try:
|
||||||
|
mnemonic_threshold = mnemonic_module.get_mnemonic_threshold(words)
|
||||||
|
except slip39.MnemonicError:
|
||||||
|
raise wire.ProcessError("Mnemonic is not valid")
|
||||||
mnemonics.append(words)
|
mnemonics.append(words)
|
||||||
remaining = mnemonic_threshold - len(mnemonics)
|
remaining = mnemonic_threshold - len(mnemonics)
|
||||||
if remaining == 0:
|
if remaining == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user