labels plugin: abort if there is not mpk

This commit is contained in:
ThomasV 2015-08-07 17:46:49 +02:00
parent 6b87256795
commit 7bf91fb7b6
1 changed files with 2 additions and 6 deletions

View File

@ -53,13 +53,13 @@ class Plugin(BasePlugin):
@hook
def load_wallet(self, wallet, window):
self.wallet = wallet
self.wallet_nonce = self.wallet.storage.get("wallet_nonce")
self.print_error("Wallet nonce is", self.wallet_nonce)
if self.wallet_nonce is None:
self.set_nonce(1)
mpk = ''.join(sorted(self.wallet.get_master_public_keys().values()))
if not mpk:
return
self.encode_password = hashlib.sha1(mpk).digest().encode('hex')[:32]
self.iv = hashlib.sha256(self.encode_password).digest()[:16]
self.wallet_id = hashlib.sha256(mpk).digest().encode('hex')
@ -81,10 +81,6 @@ class Plugin(BasePlugin):
t.setDaemon(True)
t.start()
def is_available(self):
return True
def requires_settings(self):
return True