Browse Source

no accounts in multisig wallets

283
ThomasV 11 years ago
parent
commit
a3dd9f700c
  1. 2
      gui/qt/main_window.py
  2. 29
      lib/wallet.py

2
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 # 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.notify_transactions()
self.update_account_selector() 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_lock_icon()
self.update_buttons_on_seed() self.update_buttons_on_seed()
self.update_console() self.update_console()

29
lib/wallet.py

@ -238,6 +238,8 @@ class NewWallet:
tx2.add_extra_addresses({h:tx}) tx2.add_extra_addresses({h:tx})
def can_create_accounts(self):
return True
def set_up_to_date(self,b): def set_up_to_date(self,b):
@ -1485,16 +1487,16 @@ class Wallet_2of2(NewWallet):
NewWallet.__init__(self, storage) NewWallet.__init__(self, storage)
self.storage.put('wallet_type', '2of2', True) self.storage.put('wallet_type', '2of2', True)
def can_create_accounts(self):
return False
def make_account(self, account_id, password): def make_account(self, account_id, password):
"""Creates and saves the master keys, but does not save the account""" """Creates and saves the master keys, but does not save the account"""
xpub1 = self.add_master_keys("m/", account_id, password) xpub1 = self.master_public_keys.get("m/")
xpub2 = self.add_master_keys("cold/", account_id, password) xpub2 = self.master_public_keys.get("cold/")
account = BIP32_Account_2of2({'xpub':xpub1, 'xpub2':xpub2}) 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): class Wallet_2of3(Wallet_2of2):
@ -1502,15 +1504,12 @@ class Wallet_2of3(Wallet_2of2):
NewWallet.__init__(self, storage) NewWallet.__init__(self, storage)
self.storage.put('wallet_type', '2of3', True) self.storage.put('wallet_type', '2of3', True)
def make_account(self, account_id, password): def create_accounts(self, password):
xpub1 = self.add_master_keys("m/", account_id, password) xpub1 = self.master_public_keys.get("m/")
xpub2 = self.add_master_keys("cold/", account_id.replace("m/","cold/"), password) xpub2 = self.master_public_keys.get("cold/")
xpub3 = self.add_master_keys("remote/", account_id.replace("m/","remote/"), password) xpub3 = self.master_public_keys.get("remote/")
account = BIP32_Account_2of3({'xpub':xpub1, 'xpub2':xpub2, 'xpub3':xpub3}) account = BIP32_Account_2of3({'xpub':xpub1, 'xpub2':xpub2, 'xpub3':xpub3})
return account self.add_account('m/', account)
def account_id(self, i):
return "m/%d"%i
@ -1689,12 +1688,14 @@ class WalletSynchronizer(threading.Thread):
class OldWallet(NewWallet): class OldWallet(NewWallet):
def can_create_accounts(self):
return False
def make_seed(self): def make_seed(self):
import mnemonic import mnemonic
seed = random_seed(128) seed = random_seed(128)
return ' '.join(mnemonic.mn_encode(seed)) return ' '.join(mnemonic.mn_encode(seed))
def prepare_seed(self, seed): def prepare_seed(self, seed):
import mnemonic import mnemonic
# see if seed was entered as hex # see if seed was entered as hex

Loading…
Cancel
Save