Skip to content

Commit

Permalink
increase timeout for text-based mnemonics
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansnigirev committed Nov 5, 2022
1 parent 7f26352 commit 3156ddd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/specter.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async def import_mnemonic(self):
last=(255, None))
if host == 255:
return
stream = await host.get_data(raw=True)
stream = await host.get_data(raw=True, chunk_timeout=0.5)
if not stream:
return
data = stream.read()
Expand All @@ -246,6 +246,8 @@ async def import_mnemonic(self):
# text mnemonic
else:
mnemonic = data.decode()
# split on \n and \r to avoid double-scan
mnemonic = mnemonic.split("\r")[0].split("\n")[0]
if not bip39.mnemonic_is_valid(mnemonic):
raise SpecterError("Invalid data: %r" % mnemonic)
scr = MnemonicPrompt(title="Imported mnemonic:", mnemonic=mnemonic)
Expand Down

0 comments on commit 3156ddd

Please sign in to comment.