Blockstream / Blockstream/garecovery

Can't handle alternate datadir for bitcoin core

Open
#43 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
135
Forks
67
PR merge metrics
No merged PRs in 30d

Description

After confirming the mnemonic, this error will occur if the bitcoin core is installed but the datadir is in a different location than the default of /home/[USERNAME]/.bitcoin/

This error will occur even if you make a symbolic link from the alternate datadir to /home/[USERNAME]/.bitcoin/ and even if bitcoind is running with the datadir specified.

Please provide a method to specify the Bitcoin core data directory if it does not reside in the default path.

```
WARNING:root:[Errno 2] No such file or directory: '/home/[USERNAME]/.bitcoin/.cookie'
Traceback (most recent call last):
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/bitcoincore.py", line 127, in __init__
http_auth_header = Connection.get_http_auth_header(config, args.network)
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/bitcoincore.py", line 90, in get_http_auth_header
auth_data = open(rpccookiefile, "r").read().strip().encode("ascii")
FileNotFoundError: [Errno 2] No such file or directory: '/home/[USERNAME]/.bitcoin/.cookie'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/[USERNAME]/Downloads/garecovery-master/venv/bin/garecovery-cli", line 7, in
sys.exit(recoverycli.main(sys.argv))
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/recoverycli.py", line 98, in main
txs = recovery.get_transactions()
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 198, in get_transactions
utxos = self.scan_subaccount(subaccount_pointer, clargs.args.key_search_depth)
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 94, in scan_subaccount
new_utxos = self.get_utxos(outputs)
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/two_of_two_csv.py", line 29, in get_utxos
core = bitcoincore.Connection(clargs.args)
File "/home/[USERNAME]/Downloads/garecovery-master/venv/lib/python3.8/site-packages/garecovery/bitcoincore.py", line 153, in __init__
raise exceptions.BitcoinCoreConnectionError(CORE_CONNECT_ERR.format(connstr))
UnboundLocalError: local variable 'connstr' referenced before assignment

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.