Skip to content

refactor: Consistently use context args over gArgs in node/interfaces - #27239

Merged
fanquake merged 2 commits into
bitcoin:masterfrom
maflcko:2303-args-consistent-🏯
Mar 11, 2023

Hidden character warning

The head ref may contain hidden characters: "2303-args-consistent-\ud83c\udfef"
Merged

fanquake merged 2 commits into
bitcoin:masterfrom
maflcko:2303-args-consistent-🏯

Conversation

@maflcko

@maflcko maflcko commented Mar 10, 2023

Copy link
Copy Markdown
Member

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

DrahtBot commented Mar 10, 2023 •

Copy link
Copy Markdown
Contributor

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

@sedited sedited left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

Concept ACK

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread src/node/interfaces.cpp Resolved
@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

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Contributor

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

sedited commented Mar 10, 2023

Copy link
Copy Markdown
Contributor

re-ACK facbb44

@fanquake

Copy link
Copy Markdown
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
@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