refactor: Pass ArgsManager into functions that register args #19561

pull S3RK wants to merge 3 commits into bitcoin:master from S3RK:args_manager changing 11 files +242 −237
  1. S3RK commented at 11:08 AM on July 21, 2020: contributor

    Rationale: reduce use of gArgs to decouple code and simplify future maintenance and easier unit testing.

    This PR is continuation of work started in #18926 and #18662 It covers only places that register args in ArgsManager with AddArgs() or AddHiddenArgs().

    Closes #19511

  2. in src/chainparams.cpp:344 in 68c10a1bbc outdated
     340 | @@ -341,8 +341,8 @@ class CRegTestParams : public CChainParams {
     341 |  
     342 |  void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
     343 |  {
     344 | -    if (gArgs.IsArgSet("-segwitheight")) {
     345 | -        int64_t height = gArgs.GetArg("-segwitheight", consensus.SegwitHeight);
     346 | +    if (args.IsArgSet("-segwitheight")) {
    


    S3RK commented at 11:10 AM on July 21, 2020:

    This line had been added when local args already existed. I couldn't find any reason for the use of global variable, but maybe I'm missing something.

  3. MarcoFalke commented at 11:40 AM on July 21, 2020: member

    scripted diffs shouldn't modify out-of-git-tree files. Please replace the wildcard; See other scripted diffs for examples.

  4. fanquake added the label Refactoring on Jul 21, 2020
  5. DrahtBot commented at 12:14 PM on July 21, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19624 (Interpret and validate rw_settings by MarcoFalke)
    • #19573 ([WIP] Replace unused BIP 9 logic with BIP 8 by luke-jr)
    • #19572 (ZMQ: Create "sequence" notifier, enabling client-side mempool tracking by instagibbs)
    • #19509 (Per-Peer Message Logging by troygiorshev)
    • #19485 (torcontrol: Create also a V3 ed25519-V3 onion address. by Saibato)
    • #19471 (util: Make default arg values more specific by hebasto)
    • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #19242 (Add -uaappend option to append a literal string to user agent by luke-jr)
    • #19241 (help: Generate checkpoint height from chainparams by luke-jr)
    • #19137 (wallettool: Add dump and createfromdump commands by achow101)
    • #19043 (torcontrol: add -tortarget config by MDrollette)
    • #18418 (wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 by fjahr)
    • #18267 (BIP-325: Signet [consensus] by kallewoof)
    • #18077 (net: Add NAT-PMP port forwarding support by hebasto)
    • #17127 (util: Correct permissions for datadir and wallets subdir by hebasto)
    • #16546 (External signer support - Wallet Box edition by Sjors)
    • #15421 (torcontrol: Launch a private Tor instance when not already running by luke-jr)
    • #15367 (feature: Added ability for users to add a startup command by benthecarman)
    • #14582 (wallet: always do avoid partial spends if fees are within a specified range by kallewoof)
    • #14053 (Add address-based index (attempt 4?) by marcinja)
    • #10443 (Add fee_est tool for debugging fee estimation code by ryanofsky)
    • #10102 ([experimental] Multiprocess bitcoin by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. DrahtBot cross-referenced this on Jul 21, 2020 from issue Per-Peer Message Capture by troygiorshev
  7. DrahtBot cross-referenced this on Jul 21, 2020 from issue net: Add -networkactive option by hebasto
  8. DrahtBot cross-referenced this on Jul 21, 2020 from issue util: Make default arg values more specific by hebasto
  9. DrahtBot cross-referenced this on Jul 21, 2020 from issue multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky
  10. DrahtBot cross-referenced this on Jul 21, 2020 from issue multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky
  11. DrahtBot cross-referenced this on Jul 21, 2020 from issue Add -uaappend option to append a literal string to user agent by luke-jr
  12. DrahtBot cross-referenced this on Jul 21, 2020 from issue help: Generate checkpoint height from chainparams by luke-jr
  13. DrahtBot cross-referenced this on Jul 21, 2020 from issue wallettool: Add dump and createfromdump commands by achow101
  14. DrahtBot cross-referenced this on Jul 21, 2020 from issue torcontrol: add -tortarget config by MDrollette
  15. DrahtBot cross-referenced this on Jul 21, 2020 from issue wallet: Increase OUTPUT_GROUP_MAX_ENTRIES to 100 by fjahr
  16. DrahtBot cross-referenced this on Jul 21, 2020 from issue BIP-325: Signet [consensus] by kallewoof
  17. DrahtBot cross-referenced this on Jul 21, 2020 from issue net: Add NAT-PMP port forwarding support by hebasto
  18. DrahtBot cross-referenced this on Jul 21, 2020 from issue util: Set safe permissions for data directory and `wallets/` subdir by hebasto
  19. DrahtBot cross-referenced this on Jul 21, 2020 from issue External signer support - Wallet Box edition by Sjors
  20. DrahtBot cross-referenced this on Jul 21, 2020 from issue Add loadwallet and createwallet load_on_startup options by ryanofsky
  21. DrahtBot cross-referenced this on Jul 21, 2020 from issue interfaces: Expose settings.json methods to GUI by ryanofsky
  22. DrahtBot cross-referenced this on Jul 21, 2020 from issue Add <datadir>/settings.json persistent settings storage by ryanofsky
  23. DrahtBot cross-referenced this on Jul 21, 2020 from issue torcontrol: Launch a private Tor instance when not already running by luke-jr
  24. DrahtBot cross-referenced this on Jul 21, 2020 from issue feature: Added ability for users to add a startup command by benthecarman
  25. DrahtBot cross-referenced this on Jul 21, 2020 from issue wallet: always do avoid partial spends if fees are within a specified range by kallewoof
  26. DrahtBot cross-referenced this on Jul 21, 2020 from issue Add address-based index (attempt 4?) by marcinja
  27. DrahtBot cross-referenced this on Jul 21, 2020 from issue Add new bitcoin_rw.conf file that is used for settings modified by this software itself by luke-jr
  28. DrahtBot cross-referenced this on Jul 21, 2020 from issue Add fee_est tool for debugging fee estimation code by ryanofsky
  29. DrahtBot cross-referenced this on Jul 21, 2020 from issue Multiprocess bitcoin by ryanofsky
  30. fanquake requested review from ryanofsky on Jul 22, 2020
  31. MarcoFalke commented at 8:28 AM on July 22, 2020: member

    Concept ACK, apart from my feedback ofc

  32. S3RK force-pushed on Jul 22, 2020
  33. S3RK commented at 10:34 AM on July 22, 2020: contributor

    Updated scripted diff to avoid touching out-of-tree files

  34. DrahtBot added the label Needs rebase on Jul 23, 2020
  35. refactor: add unused ArgsManager to replace gArgs a316e9ce26
  36. scripted-diff: Replace gArgs with local argsman
    -BEGIN VERIFY SCRIPT-
    sed -i -e 's/gArgs.Add/argsman.Add/g' `git grep -l "gArgs.Add"`
    -END VERIFY SCRIPT-
    9b20f66828
  37. refactor: use local argsmanager in CRegTestParams 8ed9002cd1
  38. S3RK force-pushed on Jul 29, 2020
  39. DrahtBot removed the label Needs rebase on Jul 29, 2020
  40. DrahtBot cross-referenced this on Jul 29, 2020 from issue Replace unused BIP 9 logic with draft BIP 8 by luke-jr
  41. DrahtBot cross-referenced this on Jul 29, 2020 from issue ZMQ: Create "sequence" notifier, enabling client-side mempool tracking by instagibbs
  42. DrahtBot cross-referenced this on Jul 29, 2020 from issue torcontrol: Create also a V3 ed25519-V3 onion address. by Saibato
  43. DrahtBot cross-referenced this on Jul 30, 2020 from issue Warn on unknown rw_settings by MarcoFalke
  44. MarcoFalke commented at 9:52 AM on July 30, 2020: member

    ACK 8ed9002cd14165f751442f738fbf1fb8a37611b2 👛

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK 8ed9002cd14165f751442f738fbf1fb8a37611b2 👛
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUh2ZAwAnz4O1skNtfv/RUWHkHJzWfJq4jaAvEdKEd3Mgd8q2rAU8bvUGlrEwqCa
    8ljMbgcBZbQVndx9E5QomFlEHx+C3TDjxDpU66sh5TM2qIQ7gGDA6NmMb5pabSRx
    bNG1OGDclMN2PiWWmtvKvKx5XgGUb3O7h1gpl3NJJsC/52RvU/mcY3Is9VoLwEs3
    9rD9RM5pE7VLa9l2tZiaQrp7d1EHeqKtgcIAYCoChACi44wV+HYdtQa0kzwg2LhO
    PMhtjws0damzM899I8PGApDjLlDTm61ShQJkoO42LxIHt4Sjs38kBl209MqixEd2
    Vhsw7cDFcCmqALLOXP6zuhd1cq3NY4q31e2cL3RjhnxOz1gTmirQrWZXH8Y8MmdC
    /2XT3E0kFKp+FGu5uL8WjS8/5bq0mfSGPfp7WCVEsFdRZdOdfNlrqdiTpSa9apXO
    DHEzLehro9PCsVT64GelPwGaL9Y6NKEUqu5nYo0WnLTwUzpOvOePYfuAoLFeOVsy
    x0xmmPVv
    =CHO8
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash e25142d47fe5c4ec133bc1f892c23685dd05953099c70d44b4fe8f4bd41adb03 -

    </details>

  45. MarcoFalke merged this on Jul 30, 2020
  46. MarcoFalke closed this on Jul 30, 2020

  47. ryanofsky cross-referenced this on Aug 3, 2020 from issue Parse params directly instead of through node (partial revert #10244) by ryanofsky
  48. S3RK deleted the branch on Sep 25, 2020
  49. ryanofsky cross-referenced this on Sep 28, 2020 from issue util: Fix -norpcwhitelist, -norpcallowip, and similar corner case behavior by ryanofsky
  50. Fabcien referenced this in commit 318eba92a9 on Dec 14, 2020
  51. bitcoin locked this on Feb 15, 2022

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-05-20 06:54 UTC