HomePhabricator

init: Error if ignored bitcoin.conf file is found

Description

init: Error if ignored bitcoin.conf file is found

Summary:
Show an error on startup if a bitcoin datadir that is being used contains a
bitcoin.conf file that is ignored. There are two cases where this could
happen:

  • Another way this could happen is if a -conf= command line argument points to a configuration file with a "datadir=/path" line and that specified path contains a bitcoin.conf file, which is currently ignored.

This change only adds an error message and doesn't change anything about way
settings are applied. It also doesn't trigger errors if there are redundant
-datadir or -conf settings pointing at the same configuration file, only if
they are pointing at different files and one file is being ignored.

This is a partial backport of core#27302
https://github.com/bitcoin/bitcoin/pull/27302/commits/3746f00be1b732a04976fc70cbb0661f97bbbd99

Depends on D18222

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18223

Details

Provenance
Ryan Ofsky <ryan@ofsky.org>Authored on Mar 21 2023, 17:14
PiRKCommitted on Jun 9 2025, 09:46
PiRKPushed on Jun 9 2025, 09:46
Reviewer
Restricted Project
Differential Revision
D18223: init: Error if ignored bitcoin.conf file is found
Parents
rABCe8c37660b89c: lint: fix confusing comments in test vector file
Branches
Unknown
Tags
Unknown