diff --git a/plugins/trezor.py b/plugins/trezor.py index 94ae0aab..fe4051c0 100644 --- a/plugins/trezor.py +++ b/plugins/trezor.py @@ -121,7 +121,7 @@ class Plugin(BasePlugin): def send_tx(self, tx): tx.error = None try: - self.wallet.sign_transaction(tx, None, None) + self.wallet.trezor_sign(tx) except Exception as e: tx.error = str(e) @@ -274,11 +274,13 @@ class TrezorWallet(NewWallet): return str(b64_msg_sig) def sign_transaction(self, tx, keypairs, password): - if tx.is_complete(): - return + # the tx is signed by trezor_sign, in the GUI thread if tx.error: raise BaseException(tx.error) + def trezor_sign(self, tx): + if tx.is_complete(): + return if not self.check_proper_device(): give_error('Wrong device or password')