Testnet/mainnet cross-reading of settings #8106

issue achow101 opened this issue on May 27, 2016
  1. achow101 commented at 2:35 AM on May 27, 2016: member

    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.

  2. jonasschnelli added the label GUI on May 27, 2016
  3. jonasschnelli commented at 12:44 PM on May 27, 2016: 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.

  4. maflcko commented at 1:28 PM on May 27, 2016: member

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

  5. achow101 commented at 1:30 PM on May 27, 2016: member

    -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)

  6. beirut-boop commented at 12:44 AM on March 4, 2021: none

    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.

    https://github.com/bitcoin/bitcoin/blob/8e1913ae025ad8912457abe24ae5c61da02fc17a/src/qt/bitcoin.cpp#L496-L501 https://github.com/bitcoin-core/gui/issues/212

  7. achow101 commented at 4:49 PM on September 21, 2023: member
  8. achow101 closed this on Sep 21, 2023

  9. bitcoin locked this on Sep 20, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 00:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me