src/apps/management: ask for mnemonic words twice in reset_device

pull/25/head
Pavol Rusnak 7 years ago
parent fedfde7e99
commit d5ae4d72b6
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -177,6 +177,10 @@ async def show_mnemonic_page(page: int, page_count: int, pages: list):
@ui.layout
async def check_mnemonic(ctx, mnemonic: str) -> bool:
words = mnemonic.split()
index = random.uniform(len(words))
index = random.uniform(len(words) // 2) # first half
result = await MnemonicKeyboard('Type %s. word' % (index + 1))
if result != words[index]:
return False
index = len(words) // 2 + random.uniform(len(words) // 2) # second half
result = await MnemonicKeyboard('Type %s. word' % (index + 1))
return result == words[index]

Loading…
Cancel
Save