Return None when spend key is zero (view-only wallet)

This commit is contained in:
Michał Sałaban 2018-10-22 21:46:45 +02:00
parent 005076e8a2
commit 5ee551fa4a

View file

@ -54,11 +54,14 @@ class Wallet(object):
def spend_key(self):
"""
Returns private spend key.
Returns private spend key. None if wallet is view-only.
:rtype: str
:rtype: str or None
"""
return self._backend.spend_key()
key = self._backend.spend_key()
if key.strip('0') == '':
return None
return key
def view_key(self):
"""