Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try load RPC wallet on start-up if it's not loaded #856

Merged
merged 1 commit into from
Apr 20, 2021
Merged

Try load RPC wallet on start-up if it's not loaded #856

merged 1 commit into from
Apr 20, 2021

Conversation

kristapsk
Copy link
Member

Resolves #812.

@AdamISZ AdamISZ merged commit 001dba6 into JoinMarket-Org:master Apr 20, 2021
@kristapsk kristapsk deleted the try-load-rpc_wallet branch April 20, 2021 14:34
@PulpCattel
Copy link
Member

@kristapsk

After this PR, if using 0.21+ version of Bitcoin Core, scripts like snicker-finder.py and ob-watcher.py will crash at start when using an empty rpc_wallet_file. Those scripts do not need a wallet though.
IIUC, it's because Bitcoin Core does not create a default wallet anymore.

(jmvenv) user@host:~/Dev/projects/joinmarket-clientserver/scripts/snicker$ python3 snicker-finder.py -j 682751
User data location: /home/user/.joinmarket/
Traceback (most recent call last):
  File "snicker-finder.py", line 115, in <module>
    main()
  File "snicker-finder.py", line 76, in main
    load_program_config(config_path=options.datadir)
  File "/home/user/Dev/projects/joinmarket-clientserver/jmclient/jmclient/configure.py", line 627, in load_program_config
    global_singleton.config)
  File "/home/user/Dev/projects/joinmarket-clientserver/jmclient/jmclient/configure.py", line 714, in get_blockchain_interface_instance
    rpc_wallet_file)
  File "/home/user/Dev/projects/joinmarket-clientserver/jmclient/jmclient/jsonrpc.py", line 71, in __init__
    self.call("loadwallet", [wallet_name])
  File "/home/user/Dev/projects/joinmarket-clientserver/jmclient/jmclient/jsonrpc.py", line 169, in call
    raise JsonRpcError(response["error"])
jmclient.jsonrpc.JsonRpcError: {'code': -18, 'message': "Wallet file verification failed. Failed to load database path '/home/user/.bitcoin'. Data is not in recognized format."}

I encountered this because I have an installation of JM used solely as a "toolbox", so I don't have any Bitcoin Core wallet but I still connect to RPC.

@AdamISZ
Copy link
Member

AdamISZ commented May 9, 2021

I had the same issue in testing; as I understand it, it's now essential to have rpc_wallet_file filled in in your joinmarket.cfg, since 0.21, because of this. Am I correct?

@PulpCattel
Copy link
Member

Seems so. BTW, I think it's generally a good thing, right? It was a best practice anyway.
It's a bit annoying and counter intuitive only when we are talking about those utility scripts (and also it should probably be clarified in the doc, that for 0.21+ is required and not just recommended).

e.g., snicker-finder says:

This script does NOT require a wallet, but it does require
a connection to Core, so does not work with no-blockchain.

It can be read as in "JM wallet", and from this POV it's still correct, but maybe it should be clarified; a user will not expect a dummy Bitcoin Core wallet to be required, especially after reading the above description.

@AdamISZ
Copy link
Member

AdamISZ commented May 9, 2021

Yes, absolutely. I didn't anticipate that at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request] load bitcoind wallet before interaction
3 participants