joinmarket-clientserver
joinmarket-clientserver copied to clipboard
yg-privacyenhanced.py: handling wallet .lock file
Wallet file lock issue: When yg-privacyenhanced.py has been closed uncleanly, upon next start, we have error:
python yg-privacyenhanced.py wallet.jmdat
User data location: /home/nv01/.joinmarket/
Enter wallet decryption passphrase:
Failed to load wallet, error message: RetryableStorageError('File is currently in use (locked by pid 13327). If this is a leftover from a crashed instance you need to remove the lock file `/home/nv01/.joinmarket/wallets/wallet.jmdat.lock` manually.')
Traceback (most recent call last):
File "yg-privacyenhanced.py", line 98, in <module>
minsize=minsize, gaplimit=gaplimit)
File "/home/nv01/joinmarket-clientserver/jmclient/jmclient/yieldgenerator.py", line 249, in ygmain
gap_limit=options.gaplimit)
File "/home/nv01/joinmarket-clientserver/jmclient/jmclient/wallet_utils.py", line 1126, in open_test_wallet_maybe
return open_wallet(path, mixdepth=max_mixdepth, **kwargs)
File "/home/nv01/joinmarket-clientserver/jmclient/jmclient/wallet_utils.py", line 1166, in open_wallet
raise e
File "/home/nv01/joinmarket-clientserver/jmclient/jmclient/wallet_utils.py", line 1159, in open_wallet
storage = Storage(path, password=pwd, read_only=read_only)
File "/home/nv01/joinmarket-clientserver/jmclient/jmclient/storage.py", line 109, in __init__
self._create_lock()
File "/home/nv01/joinmarket-clientserver/jmclient/jmclient/storage.py", line 297, in _create_lock
format(locked_by_pid, lock_filename))
jmclient.storage.RetryableStorageError: File is currently in use (locked by pid 13327). If this is a leftover from a crashed instance you need to remove the lock file `/home/nv01/.joinmarket/wallets/wallet.jmdat.lock` manually.
Enhancement request:
-
yg-privacyenhanced.py should detect .lock file BEFORE asking for password, why type it and verify it when it's going to fall back to console due to lock file present anyway
-
yg-privacyenhanced.py should handle this issue, detect on it's own that it's not running and delete the lock
wrt your suggestions:
1: that sounds very logical, also it could be a good first issue for someone to write a PR for as it's quite simple.
2: that's a lot more debatable, I'd say not: there is more than one kind of long running script (the other one is tumbler.py, and there is also the GUI offering the same function), so for now I'd be inclined not to bother with logic to avoid the need for manual intervention (although I agree it's technically feasible).
I agree with @AdamISZ here (doing 1 and not doing 2).
Not directly related with this issue, but probably we should re-label Beginner-friendly issues as "good first issue", as this is what Github now promotes for all repos... What do others think? @AdamISZ ? @chris-belcher ?
Great idea, thanks.
Not directly related with this issue, but probably we should re-label Beginner-friendly issues as "good first issue", as this is what Github now promotes for all repos... What do others think? @AdamISZ ? @chris-belcher ?
done
(1) is resolved now, do we have consensus to not do (2)?
+1 on not doing point 2