1
0

sweep/import key: show error in Qt GUI to user as tooltip

This commit is contained in:
SomberNight
2019-04-19 00:15:45 +02:00
parent 1110f13c62
commit a1d98d4331
7 changed files with 42 additions and 19 deletions

View File

@@ -615,11 +615,13 @@ def is_address(addr: str, *, net=None) -> bool:
or is_b58_address(addr, net=net)
def is_private_key(key: str) -> bool:
def is_private_key(key: str, *, raise_on_error=False) -> bool:
try:
k = deserialize_privkey(key)
return k is not False
except:
deserialize_privkey(key)
return True
except BaseException as e:
if raise_on_error:
raise
return False