tdefine check_password for imported wallets - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 3faeb7eab66218165d5167a9be39a78aad68df07 DIR parent ace127ee430711b4fa1f7f42e7606bf074510733 HTML Author: ThomasV <thomasv@gitorious> Date: Thu, 1 May 2014 13:08:12 +0200 define check_password for imported wallets Diffstat: M lib/wallet.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -256,7 +256,7 @@ class Abstract_Wallet: return False def check_password(self, password): - pass + raise def set_up_to_date(self,b): t@@ -1125,6 +1125,12 @@ class Imported_Wallet(Abstract_Wallet): def is_deterministic(self): return False + def check_password(self, password): + if self.imported_keys: + k, v = self.imported_keys.items()[0] + sec = pw_decode(v, password) + address = address_from_private_key(sec) + assert address == k class Deterministic_Wallet(Abstract_Wallet):