Closes #19990
Fixes an issue where a bitcoin.conf
file that contains a datadir=
setting would be incorrectly reported in the logs (see examples below). This fix is implemented by caching the path to the conf file before setting datadir
.
Master
0Default data directory /Users/matthewzipkin/Library/Application Support/Bitcoin
1Using data directory /tmp/bcdata/regtest
2Config file: /tmp/bcdata/bitcoin.conf (not found, skipping)
3Config file arg: blocksdir="/tmp/blocks"
4Config file arg: datadir="/tmp/bcdata"
5Command-line arg: regtest=""
Branch
0Default data directory /Users/matthewzipkin/Library/Application Support/Bitcoin
1Using data directory /tmp/bcdata/regtest
2Config file: /Users/matthewzipkin/Library/Application Support/Bitcoin/bitcoin.conf
3Config file arg: blocksdir="/tmp/blocks"
4Config file arg: datadir="/tmp/bcdata"
5Config file arg: prune="10000"
6Command-line arg: regtest=""
See also #27246 and https://github.com/bitcoin/bitcoin/pull/27302