mpk window: detect self and cosigner keys
This commit is contained in:
@@ -1926,9 +1926,12 @@ class ElectrumWindow(QMainWindow):
|
|||||||
vbox.addWidget(gb)
|
vbox.addWidget(gb)
|
||||||
group = QButtonGroup()
|
group = QButtonGroup()
|
||||||
first_button = None
|
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 = QRadioButton(gb)
|
||||||
b.setText(name)
|
name = 'Self' if is_mine else 'Cosigner'
|
||||||
|
b.setText(name + ' (%s)'%key)
|
||||||
|
b.key = key
|
||||||
group.addButton(b)
|
group.addButton(b)
|
||||||
vbox.addWidget(b)
|
vbox.addWidget(b)
|
||||||
if not first_button:
|
if not first_button:
|
||||||
@@ -1939,8 +1942,7 @@ class ElectrumWindow(QMainWindow):
|
|||||||
vbox.addWidget(mpk_text)
|
vbox.addWidget(mpk_text)
|
||||||
|
|
||||||
def show_mpk(b):
|
def show_mpk(b):
|
||||||
name = str(b.text())
|
mpk = mpk_dict.get(b.key, "")
|
||||||
mpk = mpk_dict.get(name, "")
|
|
||||||
mpk_text.setText(mpk)
|
mpk_text.setText(mpk)
|
||||||
|
|
||||||
group.buttonReleased.connect(show_mpk)
|
group.buttonReleased.connect(show_mpk)
|
||||||
|
|||||||
@@ -1503,9 +1503,7 @@ class Wallet_2of2(BIP32_Wallet, Mnemonic):
|
|||||||
self.add_account('0', account)
|
self.add_account('0', account)
|
||||||
|
|
||||||
def get_master_public_keys(self):
|
def get_master_public_keys(self):
|
||||||
xpub1 = self.master_public_keys.get("x1/")
|
return self.master_public_keys
|
||||||
xpub2 = self.master_public_keys.get("x2/")
|
|
||||||
return { 'Self':xpub1, 'Cosigner':xpub2 }
|
|
||||||
|
|
||||||
def get_action(self):
|
def get_action(self):
|
||||||
xpub1 = self.master_public_keys.get("x1/")
|
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})
|
account = BIP32_Account_2of3({'xpub':xpub1, 'xpub2':xpub2, 'xpub3':xpub3})
|
||||||
self.add_account('0', account)
|
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):
|
def get_action(self):
|
||||||
xpub1 = self.master_public_keys.get("x1/")
|
xpub1 = self.master_public_keys.get("x1/")
|
||||||
xpub2 = self.master_public_keys.get("x2/")
|
xpub2 = self.master_public_keys.get("x2/")
|
||||||
|
|||||||
Reference in New Issue
Block a user