electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 219461ef57f17ebe602388705dcd17f042cbb988
parent ccde1ecd95d08a5e8df3a1012d46271b7d043995
Author: ThomasV <thomasv@electrum.org>
Date:   Thu, 18 Feb 2016 11:02:16 +0100

kivy: use InvalidPassword

Diffstat:
Mgui/kivy/uix/dialogs/tx_dialog.py | 6+++++-
Mgui/kivy/uix/screens.py | 7+++----
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/gui/kivy/uix/dialogs/tx_dialog.py b/gui/kivy/uix/dialogs/tx_dialog.py @@ -7,6 +7,7 @@ from kivy.uix.label import Label from electrum_gui.kivy.i18n import _ from datetime import datetime +from electrum.util import InvalidPassword Builder.load_string(''' @@ -146,7 +147,10 @@ class TxDialog(Factory.Popup): Clock.schedule_once(lambda dt: self.__do_sign(password), 0.1) def __do_sign(self, password): - self.app.wallet.sign_transaction(self.tx, password) + try: + self.app.wallet.sign_transaction(self.tx, password) + except InvalidPassword: + self.app.show_error(_("Invalid PIN")) self.update() def do_broadcast(self): diff --git a/gui/kivy/uix/screens.py b/gui/kivy/uix/screens.py @@ -18,7 +18,7 @@ from kivy.lang import Builder from kivy.factory import Factory from kivy.utils import platform -from electrum.util import profiler, parse_URI, format_time +from electrum.util import profiler, parse_URI, format_time, InvalidPassword from electrum import bitcoin from electrum.util import timestamp_to_datetime from electrum.plugins import run_hook @@ -283,9 +283,8 @@ class SendScreen(CScreen): self.app.show_info("Signing...") try: self.app.wallet.sign_transaction(tx, password) - except Exception as e: - traceback.print_exc(file=sys.stdout) - self.app.show_error(str(e)) + except InvalidPassword: + self.app.show_error(_("Invalid PIN")) return if not tx.is_complete(): self.app.tx_dialog(tx)