It uses QSettings, which indeed uses the registry on Windows.
Thanks for the confirmation. In future versions shouldn't the Keys be under Bitcoin-core not Bitcoin-Qt for consistency?
I wonder why bitcoind doesn't check for the existence of the same registry key for consistency?
Because QSettings is a Qt-only feature. Bitcoind cannot do anything with the registry at all, it doesn't link to Qt.
Good to know.
I wonder though if this could be refactored to provide a more consistent behavior between the two clients.
For non-windows specific options wouldn't it make more sense to just write those to the bitcoin.conf. The GUI client already reads the conf file for the presence of these options.
As an example, setting the pay tx fee option in the bitcoin-core to 0.1 mBTC GUI client adds
nTransactionFee key to the registry however if the same user now starts up bitcoind it will use the default fee (0) because there is no entry in the bitcoin.conf. Since an RPC call can be made against either bitcoind or bitcoin-core (w/server=1 option) the outcome of an RPC call will depend on where it is made. Likewise if a fee of 0.2 mBTC is indicated in the bitcoin.conf then the client will still display 0.1 mBTC however the actual fee paid will be 0.2 mBTC. The client does provide a warning that the setting has been overriden but this isn't exactly user friendly or intuitive.
Do you agree that keeping it
DRY would be better? Refactor bitcoin-core so that both bitcoind and bitcoin-core use the bitcoin.conf to store non client specific settings (i.e. data directory, tx fee, dbcache, proxy, etc). The registry would only be used for client specific settings (location of windows, units to display, minimize handling, etc).
To be consistent that would also include the data directory however the registry can still be used indirectly by providing the location to the configuration file itself.
1) User launches bitcoin-core with no data directory created.
2) Wizard prompts user for location of data directory.
3) Create bitcoin.conf in directory is needed.
4) Set data directory in bitcoin.conf.
5) Add registry entry pointing to the bitcoin.conf
On startup the client would check for existance of "ConfigFile" registry key and if present load the bitcoin.conf to determine the data directory and other non-client specific settings.
Just something to think about to make the behavior of the GUI and deamon consistent. The other option is to simply stop bundling the two and treat them like independent applications.