Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testnet/mainnet cross-reading of settings #8106

Closed
achow101 opened this issue May 27, 2016 · 5 comments
Closed

Testnet/mainnet cross-reading of settings #8106

achow101 opened this issue May 27, 2016 · 5 comments
Labels

Comments

@achow101
Copy link
Member

achow101 commented May 27, 2016

In the settings, the Testnet seems to be reading from and setting some options for mainnet and not testnet. I have noticed this with at least the strDataDir option.

Replication steps on Ubuntu 15.10

  1. Tail ~/.config/Bitcoin-Qt.conf and ~/.config/Bitcoin-Qt-testnet.conf
  2. Reset the testnet settings by going to Settings > Reset Options. Notice how the testnet conf file changes.
  3. Now start Bitcoin core with -choosedatadir -testnet.

After the third step, you will see that the strDataDir setting is not added to the testnet conf but is added/changed in the normal conf file.

@jonasschnelli
Copy link
Contributor

The settings overwritten by the GUI (QSettings) are stored/managed by QT. The filename is handled by Qt. I guess chaining the app name (using testnet switched the application name somewhere in init) could lead to a mixed settings read/write behavior.

@maflcko
Copy link
Member

maflcko commented May 27, 2016

Are you starting with -choosedatadir or -choosedatadir -testnet?

@achow101
Copy link
Member Author

-choosedatadir -testnet

On May 27, 2016 9:28:54 AM MarcoFalke notifications@github.com wrote:

Are you starting with -choosedatadir or -choosedatadir -testnet?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#8106 (comment)

@beirut-boop
Copy link

Perhaps it would work as intended if we would use the NetworkStyle app name when locating QSettings. E.g.:

    /// 3. Application identification
    // must be set before OptionsModel is initialized or translations are loaded,
    // as it is used to locate QSettings
    QApplication::setOrganizationName(QAPP_ORG_NAME);
    QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN);
-    QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);
+    QApplication::setApplicationName(networkStyle->getAppName());

But I am not confident this is all there is to it.

bitcoin/src/qt/bitcoin.cpp

Lines 496 to 501 in 8e1913a

/// 3. Application identification
// must be set before OptionsModel is initialized or translations are loaded,
// as it is used to locate QSettings
QApplication::setOrganizationName(QAPP_ORG_NAME);
QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN);
QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);

bitcoin-core/gui#212

@achow101
Copy link
Member Author

Moved to GUI repo: bitcoin-core/gui#759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants