electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit f97fdf3ba81d481f67bdb78bfccb011eb53d2133
parent 9b99693ca11382a35ba010c103ecd339c2955431
Author: ThomasV <thomasv@electrum.org>
Date:   Mon, 22 Feb 2016 15:44:31 +0100

labels plugin: use get_fingerprint

Diffstat:
Mlib/wallet.py | 9+++++++++
Mplugins/labels/labels.py | 2+-
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git 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 @@ -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]