Handle invalid PIN on exporting private key

Prevent Android App from crashing when a wrong PIN is entered.
This commit is contained in:
racquemis 2018-01-14 08:42:38 +01:00 committed by SomberNight
parent 53fc343b4a
commit d5e20d607e
1 changed files with 6 additions and 2 deletions

View File

@ -928,6 +928,10 @@ class ElectrumWindow(App):
return
if not self.wallet.can_export():
return
key = str(self.wallet.export_private_key(addr, password)[0])
pk_label.data = key
try:
key = str(self.wallet.export_private_key(addr, password)[0])
pk_label.data = key
except InvalidPassword:
self.show_error("Invalid PIN")
return
self.protected(_("Enter your PIN code in order to decrypt your private key"), show_private_key, (addr, pk_label))