commit 973f7f9fe5f1df4c2744df1233b6489b5b5f247d
parent cbb1a39879c2b807148e80709bbc69b1c2eee002
Author: ThomasV <thomasv@gitorious>
Date: Tue, 24 Mar 2015 17:33:08 +0100
mpk window: detect self and cosigner keys
Diffstat:
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
@@ -1926,9 +1926,12 @@ class ElectrumWindow(QMainWindow):
vbox.addWidget(gb)
group = QButtonGroup()
first_button = None
- for name in sorted(mpk_dict.keys()):
+ for key in sorted(mpk_dict.keys()):
+ is_mine = self.wallet.master_private_keys.has_key(key)
b = QRadioButton(gb)
- b.setText(name)
+ name = 'Self' if is_mine else 'Cosigner'
+ b.setText(name + ' (%s)'%key)
+ b.key = key
group.addButton(b)
vbox.addWidget(b)
if not first_button:
@@ -1939,8 +1942,7 @@ class ElectrumWindow(QMainWindow):
vbox.addWidget(mpk_text)
def show_mpk(b):
- name = str(b.text())
- mpk = mpk_dict.get(name, "")
+ mpk = mpk_dict.get(b.key, "")
mpk_text.setText(mpk)
group.buttonReleased.connect(show_mpk)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -1503,9 +1503,7 @@ class Wallet_2of2(BIP32_Wallet, Mnemonic):
self.add_account('0', account)
def get_master_public_keys(self):
- xpub1 = self.master_public_keys.get("x1/")
- xpub2 = self.master_public_keys.get("x2/")
- return { 'Self':xpub1, 'Cosigner':xpub2 }
+ return self.master_public_keys
def get_action(self):
xpub1 = self.master_public_keys.get("x1/")
@@ -1530,12 +1528,6 @@ class Wallet_2of3(Wallet_2of2):
account = BIP32_Account_2of3({'xpub':xpub1, 'xpub2':xpub2, 'xpub3':xpub3})
self.add_account('0', account)
- def get_master_public_keys(self):
- xpub1 = self.master_public_keys.get("x1/")
- xpub2 = self.master_public_keys.get("x2/")
- xpub3 = self.master_public_keys.get("x3/")
- return {'x1':xpub1, 'x2':xpub2, 'x3':xpub3}
-
def get_action(self):
xpub1 = self.master_public_keys.get("x1/")
xpub2 = self.master_public_keys.get("x2/")