commit fa4c2b96d71646a16d3cea45565388dd98fe48e9
parent ac93b86ebcd7770a250bea63a81d0739277eb2a3
Author: ThomasV <thomasv@gitorious>
Date: Mon, 5 May 2014 12:03:01 +0200
p2sh wallets cannot create accounts
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -203,6 +203,7 @@ class ElectrumWindow(QMainWindow):
self.password_menu.setEnabled(not self.wallet.is_watching_only())
self.seed_menu.setEnabled(self.wallet.has_seed())
self.mpk_menu.setEnabled(self.wallet.is_deterministic())
+ self.import_menu.setEnabled(self.wallet.can_create_accounts() or not self.wallet.is_deterministic())
self.update_lock_icon()
self.update_buttons_on_seed()
@@ -296,7 +297,7 @@ class ElectrumWindow(QMainWindow):
self.private_keys_menu = wallet_menu.addMenu(_("&Private keys"))
self.private_keys_menu.addAction(_("&Sweep"), self.sweep_key_dialog)
- self.private_keys_menu.addAction(_("&Import"), self.do_import_privkey)
+ self.import_menu = self.private_keys_menu.addAction(_("&Import"), self.do_import_privkey)
self.private_keys_menu.addAction(_("&Export"), self.export_privkeys_dialog)
wallet_menu.addAction(_("&Export History"), self.export_history_dialog)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -1450,6 +1450,9 @@ class Wallet_2of2(NewWallet):
NewWallet.__init__(self, storage)
self.storage.put('wallet_type', '2of2', True)
+ def can_create_accounts(self):
+ return False
+
def create_account(self):
xpub1 = self.master_public_keys.get("m/")
xpub2 = self.master_public_keys.get("cold/")