commit 36c90502ae4cdbddb5ed9648f3f9942a1b8c0ed1
parent 2baf8e2079959c843508cf3449fa10497ae7d009
Author: ThomasV <thomasv@electrum.org>
Date: Fri, 2 Sep 2016 10:58:54 +0200
more trustedcoin fixes
Diffstat:
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/plugins/trustedcoin/qt.py b/plugins/trustedcoin/qt.py
@@ -37,20 +37,8 @@ from electrum_gui.qt.amountedit import AmountEdit
from electrum_gui.qt.main_window import StatusBarButton
from electrum.i18n import _
from electrum.plugins import hook
-
from trustedcoin import TrustedCoinPlugin, server
-def need_server(wallet, tx):
- from electrum.keystore import parse_xpubkey, is_xpubkey
- # Detect if the server is needed
- long_id, short_id = wallet.get_user_id()
- xpub3 = wallet.master_public_keys['x3/']
- for x in tx.inputs_to_sign():
- if is_xpubkey(x):
- xpub, sequence = parse_xpubkey(x)
- if xpub == xpub3:
- return True
- return False
class Plugin(TrustedCoinPlugin):
@@ -98,7 +86,7 @@ class Plugin(TrustedCoinPlugin):
if not wallet.can_sign_without_server():
self.print_error("twofactor:sign_tx")
auth_code = None
- if need_server(wallet, tx):
+ if wallet.keystores['x3/'].get_tx_derivations(tx):
auth_code = self.auth_dialog(window)
else:
self.print_error("twofactor: xpub3 not needed")
diff --git a/plugins/trustedcoin/trustedcoin.py b/plugins/trustedcoin/trustedcoin.py
@@ -194,7 +194,7 @@ class Wallet_2fa(Multisig_Wallet):
self.billing_info = None
def can_sign_without_server(self):
- return not self.keystores.get('x2/').is_watching_only()
+ return not self.keystores['x2/'].is_watching_only()
def get_user_id(self):
return get_user_id(self.storage)