add error message about wallet not loaded. fixes #2756

This commit is contained in:
ThomasV 2017-08-17 11:06:53 +02:00
parent c6e09a6038
commit cfa037fd6f
1 changed files with 3 additions and 0 deletions

View File

@ -80,6 +80,9 @@ def command(s):
known_commands[name] = Command(func, s)
@wraps(func)
def func_wrapper(*args, **kwargs):
c = known_commands[func.__name__]
if c.requires_wallet and args[0].wallet is None:
raise BaseException("wallet not loaded. Use 'electrum daemon load_wallet'")
return func(*args, **kwargs)
return func_wrapper
return decorator