electrum

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

commit b1704ce9113880216467832341be9ea961549890
parent cd0ab62cae17f80dc8ceb4c60d420b512d680649
Author: Neil Booth <kyuupichan@gmail.com>
Date:   Sun, 13 Dec 2015 18:13:24 +0900

Fix multiple trustedcoin bugs.

Diffstat:
Mplugins/trustedcoin/qt.py | 35++++++++++++++++++++++++++++++++---
Mplugins/trustedcoin/trustedcoin.py | 13-------------
2 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/plugins/trustedcoin/qt.py b/plugins/trustedcoin/qt.py @@ -1,4 +1,23 @@ +#!/usr/bin/env python +# +# Electrum - Lightweight Bitcoin Client +# Copyright (C) 2015 Thomas Voegtlin +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + from functools import partial +from threading import Thread from PyQt4.QtGui import * from PyQt4.QtCore import * @@ -10,7 +29,19 @@ from electrum_gui.qt.main_window import StatusBarButton from electrum.i18n import _ from electrum.plugins import hook -from trustedcoin import TrustedCoinPlugin +from trustedcoin import TrustedCoinPlugin, Wallet_2fa + +def need_server(wallet, tx): + from electrum.account import BIP32_Account + # 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 x[0:2] == 'ff': + xpub, sequence = BIP32_Account.parse_xpubkey(x) + if xpub == xpub3: + return True + return False class Plugin(TrustedCoinPlugin): @@ -240,5 +271,3 @@ class Plugin(TrustedCoinPlugin): except: QMessageBox.information(window, _('Message'), _('Incorrect password'), _('OK')) pw.setText('') - - diff --git a/plugins/trustedcoin/trustedcoin.py b/plugins/trustedcoin/trustedcoin.py @@ -16,7 +16,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -from threading import Thread import socket import os import re @@ -270,18 +269,6 @@ def make_billing_address(wallet, num): address = public_key_to_bc_address( cK ) return address -def need_server(wallet, tx): - from electrum.account import BIP32_Account - # 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 x[0:2] == 'ff': - xpub, sequence = BIP32_Account.parse_xpubkey(x) - if xpub == xpub3: - return True - return False - class TrustedCoinPlugin(BasePlugin):