use an assert to check password
This commit is contained in:
parent
180035296e
commit
81ddf7e1d2
1 changed files with 1 additions and 2 deletions
|
@ -238,8 +238,7 @@ class Wallet:
|
||||||
|
|
||||||
def encrypt(self, password):
|
def encrypt(self, password):
|
||||||
assert not self.is_locked, "Cannot re-encrypt a locked wallet, unlock first."
|
assert not self.is_locked, "Cannot re-encrypt a locked wallet, unlock first."
|
||||||
if not password:
|
assert password, "Cannot encrypt with blank password."
|
||||||
raise ValueError("Cannot encrypt with blank password.")
|
|
||||||
self.encryption_password = password
|
self.encryption_password = password
|
||||||
self.preferences[ENCRYPT_ON_DISK] = True
|
self.preferences[ENCRYPT_ON_DISK] = True
|
||||||
self.save()
|
self.save()
|
||||||
|
|
Loading…
Reference in a new issue