Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Mar 10, 2023

Currently node/interfaces.cpp uses a mix of gArgs vs m_context->args. This is fine, because outside of tests those should be identical. However, it makes the code inconsistent and harder to use in tests.

Fix that by using args from the context consistently. Do the same in init.cpp, where gArgs and args are inconsistently used in the same scope or even line.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 10, 2023

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

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK ryanofsky
Concept ACK fanquake
Stale ACK TheCharlatan

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25572 (refactor: Introduce EvictionManager and use it for the inbound eviction logic by dergoegge)
  • #25268 (refactor: Introduce EvictionManager by dergoegge)
  • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
  • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
  • #10102 (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.

@DrahtBot DrahtBot changed the title refactor: Consistenly use context args over gArgs in node/interfaces refactor: Consistenly use context args over gArgs in node/interfaces Mar 10, 2023
Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK facbb44

This has been confusing me recently, thank you for cleaning this up. I reproduced the patchset and did not find similar mixed uses of context and gArgs in other files.

@fanquake
Copy link
Member

Concept ACK

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK facbb444bf5aea2bbaa4a4246a8a2c661d9bf314. Thanks for the cleanup. Could s/consistenly/consistently/ too

@maflcko maflcko changed the title refactor: Consistenly use context args over gArgs in node/interfaces refactor: Consistently use context args over gArgs in node/interfaces Mar 10, 2023
@maflcko maflcko force-pushed the 2303-args-consistent- branch from facbb44 to fa3e9b4 Compare March 10, 2023 16:30
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review ACK fa3e9b4

@DrahtBot DrahtBot requested a review from sedited March 10, 2023 16:35
@sedited
Copy link
Contributor

sedited commented Mar 10, 2023

re-ACK facbb44

@fanquake
Copy link
Member

@TheCharlatan note that you've re-ACK'd the wrong commit hash.

@fanquake fanquake merged commit 40d0b0a into bitcoin:master Mar 11, 2023
@maflcko maflcko deleted the 2303-args-consistent-🏯 branch March 11, 2023 11:12
@bitcoin bitcoin deleted a comment Mar 12, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 12, 2023
…gs in node/interfaces

fa3e9b4 refactor: Consistently use args over gArgs in init.cpp (MarcoFalke)
fa89112 refactor: Consistently use context args over gArgs in node/interfaces (MarcoFalke)

Pull request description:

  Currently `node/interfaces.cpp` uses a mix of `gArgs` vs `m_context->args`. This is fine, because outside of tests those should be identical. However, it makes the code inconsistent and harder to use in tests.

  Fix that by using `args` from the context consistently. Do the same in `init.cpp`, where `gArgs` and `args` are inconsistently used in the same scope or even line.

ACKs for top commit:
  ryanofsky:
    Code review ACK fa3e9b4

Tree-SHA512: bcd52f176794ebb1ecb9e1922411f7b84d212ae13bad314a1961b85f3077f645fca71fb0124c0889ebfdd8b59a0903b99b9985b1a4fb8f152aa6d7f0126fe5c7
@bitcoin bitcoin locked and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants