add error message about wallet not loaded. fixes #2756
This commit is contained in:
parent
c6e09a6038
commit
cfa037fd6f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue