electrum

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

commit a3dd9f700cefc74ea760aa0678f3e03c65dc7b9a
parent e7a71ff8063fd8c40fb4848df3ddc6c08ec9e4cd
Author: ThomasV <thomasv@gitorious>
Date:   Thu, 24 Apr 2014 14:29:08 +0200

no accounts in multisig wallets

Diffstat:
Mgui/qt/main_window.py | 2+-
Mlib/wallet.py | 29+++++++++++++++--------------
2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -269,7 +269,7 @@ class ElectrumWindow(QMainWindow): # Once GUI has been initialized check if we want to announce something since the callback has been called before the GUI was initialized self.notify_transactions() self.update_account_selector() - self.new_account.setEnabled(self.wallet.seed_version>4) + self.new_account.setEnabled(self.wallet.can_create_accounts()) self.update_lock_icon() self.update_buttons_on_seed() self.update_console() diff --git a/lib/wallet.py b/lib/wallet.py @@ -238,6 +238,8 @@ class NewWallet: tx2.add_extra_addresses({h:tx}) + def can_create_accounts(self): + return True def set_up_to_date(self,b): @@ -1485,16 +1487,16 @@ class Wallet_2of2(NewWallet): NewWallet.__init__(self, storage) self.storage.put('wallet_type', '2of2', True) + def can_create_accounts(self): + return False def make_account(self, account_id, password): """Creates and saves the master keys, but does not save the account""" - xpub1 = self.add_master_keys("m/", account_id, password) - xpub2 = self.add_master_keys("cold/", account_id, password) + xpub1 = self.master_public_keys.get("m/") + xpub2 = self.master_public_keys.get("cold/") account = BIP32_Account_2of2({'xpub':xpub1, 'xpub2':xpub2}) - return account + self.add_account('m/', account) - def account_id(self, i): - return "m/%d"%i class Wallet_2of3(Wallet_2of2): @@ -1502,15 +1504,12 @@ class Wallet_2of3(Wallet_2of2): NewWallet.__init__(self, storage) self.storage.put('wallet_type', '2of3', True) - def make_account(self, account_id, password): - xpub1 = self.add_master_keys("m/", account_id, password) - xpub2 = self.add_master_keys("cold/", account_id.replace("m/","cold/"), password) - xpub3 = self.add_master_keys("remote/", account_id.replace("m/","remote/"), password) + def create_accounts(self, password): + xpub1 = self.master_public_keys.get("m/") + xpub2 = self.master_public_keys.get("cold/") + xpub3 = self.master_public_keys.get("remote/") account = BIP32_Account_2of3({'xpub':xpub1, 'xpub2':xpub2, 'xpub3':xpub3}) - return account - - def account_id(self, i): - return "m/%d"%i + self.add_account('m/', account) @@ -1689,12 +1688,14 @@ class WalletSynchronizer(threading.Thread): class OldWallet(NewWallet): + def can_create_accounts(self): + return False + def make_seed(self): import mnemonic seed = random_seed(128) return ' '.join(mnemonic.mn_encode(seed)) - def prepare_seed(self, seed): import mnemonic # see if seed was entered as hex