1

I have read bitcoin.conf Configuration File which mentions: The configuration file is a plain text file and consists of option=value entries, one per line. Leading and trailing whitespaces are removed.

So which of the following are valid:

  • option=value
  • option=value
  • option =value
  • option=value
  • option = value

?

I know I can try the above options. However, that brings me to the original question: Where can I find the parser implementation of bitcoin.conf files that Bitcoin Core uses?

1 Answer 1

4

So which of the following are valid:

All of them, as the parser does trim whitespace before and after the string, and before and after both the name and value after splitting them.

However, that brings me to the original question: Where can I find the parser implementation of bitcoin.conf files that Bitcoin Core uses?

Config file handling can be found in src/util/system.cpp, with the main function being ReadConfigFiles. The options are parsed in GetConfigOptions.

1
  • Thank you! Very helpful.
    – Kiminuo
    Commented Jan 9, 2023 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.