Skip to content

Commit 250fdae

Browse files
authored
Merge pull request spesmilo#10013 from f321x/fix_command_gettransaction
commands: fix: only try to get wallet if wallet_path
2 parents d8014ac + 9d0a40d commit 250fdae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

electrum/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ async def func_wrapper(*args, **kwargs):
168168
if 'wallet' in cmd.options:
169169
wallet_path = kwargs.pop('wallet_path', None) # unit tests may set wallet and not wallet_path
170170
wallet = kwargs.get('wallet', None) # run_offline_command sets both
171-
if wallet is None:
171+
if wallet is None and wallet_path is not None:
172172
wallet = daemon.get_wallet(wallet_path)
173173
if wallet is None:
174174
raise UserFacingException('wallet not loaded')
175175
kwargs['wallet'] = wallet
176-
if cmd.requires_password and password is None and wallet.has_password():
176+
if cmd.requires_password and password is None and wallet and wallet.has_password():
177177
password = wallet.get_unlocked_password()
178178
if password:
179179
kwargs['password'] = password

0 commit comments

Comments
 (0)