commit 0ce2c870bb5faf3bc9e627f08188b63cdf8fb944
parent 5ce50f44210e3775e160ad7ec783220efc1918d8
Author: ThomasV <thomasv@gitorious>
Date: Mon, 7 Jul 2014 15:43:02 +0200
fixes for pending accounts
Diffstat:
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -1775,7 +1775,7 @@ class ElectrumWindow(QMainWindow):
self.wallet.create_pending_account(name, password)
self.update_address_tab()
- self.tabs.setCurrentIndex(2)
+ self.tabs.setCurrentIndex(3)
diff --git a/lib/account.py b/lib/account.py
@@ -81,19 +81,16 @@ class Account(object):
class PendingAccount(Account):
def __init__(self, v):
- try:
- self.pending_pubkey = v['pending_pubkey']
- except:
- pass
+ self.pending_address = v['pending']
def get_addresses(self, is_change):
- return []
+ return [self.pending_address]
def has_change(self):
return False
def dump(self):
- return {} #{'pending_pubkey':self.pending_pubkey }
+ return {'pending':self.pending_address }
def get_name(self, k):
return _('Pending account')
@@ -265,7 +262,9 @@ class BIP32_Account(Account):
return d
def first_address(self):
- return self.get_address(0,0)
+ pubkeys = self.derive_pubkeys(0, 0)
+ address = self.pubkeys_to_address(pubkeys)
+ return address
def get_master_pubkeys(self):
return [self.xpub]
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -1256,7 +1256,7 @@ class Deterministic_Wallet(Abstract_Wallet):
return True
def get_action(self):
- if not self.get_master_public_key():
+ if not self.master_public_keys:
return 'create_seed'
if not self.accounts:
return 'create_accounts'
@@ -1278,7 +1278,7 @@ class NewWallet(Deterministic_Wallet):
def get_master_public_key(self):
"""xpub of the main account"""
- return self.master_public_keys["m/0'"]
+ return self.master_public_keys.get("m/0'")
def get_master_public_keys(self):
out = {}
@@ -1559,8 +1559,8 @@ class Wallet(object):
config = storage.config
self.wallet_types = [
- ('standard', ("Standard wallet"), OldWallet),
- ('imported', ("Imported wallet"), Imported_Wallet),
+ ('standard', ("Standard wallet"), NewWallet if config.get('bip32') else OldWallet),
+ ('imported', ("Imported wallet"), Imported_Wallet),
('2of2', ("Multisig wallet (2 of 2)"), Wallet_2of2),
('2of3', ("Multisig wallet (2 of 3)"), Wallet_2of3)
]