-
Notifications
You must be signed in to change notification settings - Fork 38.8k
refactor: Remove ::Params() global from CChainState #21789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Remove ::Params() global from CChainState #21789
Conversation
fa5915e to
fad0c2a
Compare
|
Concept ACK, will review soon |
|
Concept ACK |
1 similar comment
|
Concept ACK |
fad0c2a to
fa4b981
Compare
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
|
Concept ACK. It looks like a very nice simplification which makes it harder to make a mistake. |
fae8528 to
fa49430
Compare
|
🕵️ @sipa has been requested to review this pull request as specified in the REVIEWERS file. |
fa49430 to
fad6615
Compare
fad6615 to
eeee9c6
Compare
eeee9c6 to
faa72ee
Compare
|
The main change in the first commit (fa216cc7) seems to be: "refactor: Add Also, the changes like this fa216cc#diff-97c3a52bc5fad452d82670a7fd291800bae20c7bc35bb82686c2c0a4ea7b5b98R2284 in the first commit (fa216cc7) can probably be moved to the second commit (fa06aaacf3b9c35d9e30c883bcd7780dcf0bceda) so that the first commit would only introduce Changes in fa216cc79267ba25fa3709982626def61f4abe2a & fa06aaacf3b9c35d9e30c883bcd7780dcf0bceda LGTM. |
|
Concept ACK |
|
I think the two commits are nicely split up. The first one removes it from inside the functions, the second removes the arg of the functions. |
faa72ee to
2222da8
Compare
|
ACK 2222da832066d06be3ff8752e49008fef71eb668 |
…ctions It is confusing and verbose to repeatedly access the global when a member variable can simply refer to it.
Passing this is confusing and redundant with the m_params member.
2222da8 to
fa0d921
Compare
|
Rebased |
|
ACK fa0d921 |
|
utACK fa0d921 |
| for (int i = 0; i < 10; ++i) { | ||
| BlockValidationState state; | ||
| m_node.chainman->ActiveChainstate().InvalidateBlock(state, Params(), active.Tip()); | ||
| m_node.chainman->ActiveChainstate().InvalidateBlock(state, active.Tip()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is #include <chainparams.h> still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, will try to remove if I have to force push
theStack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK fa0d921 🍉
Nice refactoring idea, glad to see this simplification of the CChainState interface.
The
::Params()global is verbose and confusing. Also it makes tests a bit harder to write because they'd have to mock a global.Fix all issues by simply using a member variable that points to the right params.
(Can be reviewed with
--word-diff-regex=.)