Chainparams: DRY: Make qt/guiutil.cpp fit BIP70 chain name strings #6908

pull jtimon wants to merge 1 commits into bitcoin:master from jtimon:chainparams-bip70-0.12.99 changing 1 files +9 −10
  1. jtimon commented at 9:25 pm on October 29, 2015: contributor

    As a side effect, the qt user will see “test” instead of “testnet”.

    This simplifies creating new testchains by not having to introduce a new special case with each chain in this part of the code. The resulting code is also less redundant and shorter even with only 2 testchains.

    Part of #6382

  2. dcousens commented at 5:53 am on October 30, 2015: contributor
    utACK
  3. laanwj added the label Refactoring on Nov 3, 2015
  4. BIP70: Chainparams: DRY: Make qt/guiutil.cpp fit BIP70 chain name strings
    As a side effect, the qt user will see "test" instead of "testnet"
    c53d48a6b3
  5. in src/qt/guiutil.cpp: in 7718d3b44e outdated
    588-
    589-    return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk";
    590+    std::string chain = ChainNameFromCommandLine();
    591+    if (chain == CBaseChainParams::MAIN)
    592+        return GetSpecialFolderPath(CSIDL_STARTUP) / "Bitcoin.lnk";
    593+    return GetSpecialFolderPath(CSIDL_STARTUP) / strprintf("Bitcoin (%s).lnk", chain);
    


    laanwj commented at 4:59 pm on November 3, 2015:
    This is not backwards compatible. The problem is that a startup link for testnet may already have been created. The scenario that the user enables testnet link at startup, upgrades, and then they cannot disable it anymore because it deletes a different link.
  6. jtimon force-pushed on Nov 4, 2015
  7. jtimon commented at 1:02 pm on November 4, 2015: contributor
    Good catch @laanwj . I hopefully fixed it.
  8. laanwj commented at 4:03 pm on November 4, 2015: member
    Looks good to me now. utACK
  9. MarcoFalke commented at 7:27 pm on November 5, 2015: member
    utACK
  10. laanwj merged this on Nov 9, 2015
  11. laanwj closed this on Nov 9, 2015

  12. laanwj referenced this in commit f24880b132 on Nov 9, 2015
  13. MarcoFalke locked this on Sep 8, 2021

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: 2024-07-08 22:13 UTC

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