gui: warn when config file not found at custom datadir path#286
Open
Bortlesboat wants to merge 2 commits into
Open
gui: warn when config file not found at custom datadir path#286Bortlesboat wants to merge 2 commits into
Bortlesboat wants to merge 2 commits into
Conversation
When a custom datadir is set via the GUI, bitcoin.conf is looked up relative to that directory instead of the default data directory. If the file doesn't exist there, settings are silently ignored with no indication in the log. Add a LogWarning when the resolved default config path doesn't exist and -conf was not explicitly set, so that users can diagnose why their bitcoin.conf settings aren't being applied.
rleed
suggested changes
Mar 18, 2026
| // which can happen when a custom datadir moves the base path away from | ||
| // the default location where the user's bitcoin.conf actually lives. | ||
| if (!IsArgSet("-conf") && !stream.good()) { | ||
| LogWarning("Config file %s not found; settings from it will not be applied. " |
There was a problem hiding this comment.
Nit: it is redundant to say that settings won't be applied from a file that cannot be found. Consider the following revision:
Config file %s doesn't exist or cannot be read; no settings will be applied.
Author
There was a problem hiding this comment.
Good point — "doesn't exist or cannot be read" is more precise since !stream.good() can also fail on permission issues, not just a missing file. Updated the first part.
I kept the second sentence though — without it the user just gets told something's wrong with no idea what to do about it. The -conf hint especially is worth keeping since that's the actual fix for this scenario.
Dropped the "settings from it will not be applied" bit since as you said that's implied.
Use "doesn't exist or cannot be read" instead of "not found" to more precisely describe the !stream.good() failure modes.
rleed
approved these changes
Mar 19, 2026
Ari4ka
approved these changes
Mar 19, 2026
eatray
approved these changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a custom datadir is set via the GUI,
bitcoin.confis resolved relative to that directory. If the user's config file lives at the default data directory (as is common), it gets silently ignored — no error, no log message, nothing to indicate why settings aren't being applied.This adds a
LogWarningwhen the default config file path doesn't exist and-noconfwasn't set, so the issue shows up indebug.log.Fixes #282