commit 23c02692521d0b6c6bbe05e1bb574957ddd6e98b
parent d0cb19a0b2375dbb2a24e0a9c63ec44e2e1c4ff8
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 9 Nov 2017 22:21:01 +0100
Merge pull request #3258 from SomberNight/wallet_check_password_dedup
wallet.check_password() remove code duplication
Diffstat:
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -1339,6 +1339,9 @@ class Abstract_Wallet(PrintError):
def has_password(self):
return self.storage.get('use_encryption', False)
+ def check_password(self, password):
+ self.keystore.check_password(password)
+
def sign_message(self, address, message, password):
index = self.get_address_index(address)
return self.keystore.sign_message(index, message, password)
@@ -1364,9 +1367,6 @@ class Simple_Wallet(Abstract_Wallet):
def can_change_password(self):
return self.keystore.can_change_password()
- def check_password(self, password):
- self.keystore.check_password(password)
-
def update_password(self, old_pw, new_pw, encrypt=False):
if old_pw is None and self.has_password():
raise InvalidPassword()
@@ -1394,9 +1394,6 @@ class Imported_Wallet(Simple_Wallet):
def get_keystores(self):
return [self.keystore] if self.keystore else []
- def check_password(self, password):
- self.keystore.check_password(password)
-
def can_import_privkey(self):
return bool(self.keystore)
@@ -1792,9 +1789,6 @@ class Multisig_Wallet(Deterministic_Wallet):
self.storage.set_password(new_pw, encrypt)
self.storage.write()
- def check_password(self, password):
- self.keystore.check_password(password)
-
def has_seed(self):
return self.keystore.has_seed()