From f97fdf3ba81d481f67bdb78bfccb011eb53d2133 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 22 Feb 2016 15:44:31 +0100 Subject: [PATCH] labels plugin: use get_fingerprint --- lib/wallet.py | 9 +++++++++ plugins/labels/labels.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/wallet.py b/lib/wallet.py index 1bf0cafc..9f5d76ca 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -1411,6 +1411,8 @@ class Abstract_Wallet(PrintError): return -1, (0, 0) return sorted(map(lambda x: self.get_payment_request(x, config), self.receive_requests.keys()), key=f) + def get_fingerprint(self): + raise NotImplementedError() class Imported_Wallet(Abstract_Wallet): @@ -1445,6 +1447,8 @@ class Imported_Wallet(Abstract_Wallet): def is_beyond_limit(self, address, account, is_change): return False + def get_fingerprint(self): + return '' class Deterministic_Wallet(Abstract_Wallet): @@ -1574,6 +1578,8 @@ class Deterministic_Wallet(Abstract_Wallet): out[name] = mpk_text return out + def get_fingerprint(self): + return self.get_master_public_key() class BIP32_Wallet(Deterministic_Wallet): @@ -1850,6 +1856,9 @@ class Multisig_Wallet(BIP32_RD_Wallet, Mnemonic): if not self.accounts: return 'create_main_account' + def get_fingerprint(self): + return ''.join(sorted(self.get_master_public_keys().values())) + class OldWallet(Deterministic_Wallet): wallet_type = 'old' diff --git a/plugins/labels/labels.py b/plugins/labels/labels.py index c36066da..8f968ad2 100644 --- a/plugins/labels/labels.py +++ b/plugins/labels/labels.py @@ -136,7 +136,7 @@ class LabelsPlugin(BasePlugin): def start_wallet(self, wallet): nonce = self.get_nonce(wallet) self.print_error("wallet", wallet.basename(), "nonce is", nonce) - mpk = ''.join(sorted(wallet.get_master_public_keys().values())) + mpk = wallet.get_fingerprint() if not mpk: return password = hashlib.sha1(mpk).digest().encode('hex')[:32]