Skip to content

Conversation

@jonatack
Copy link
Member

@jonatack jonatack commented Jul 24, 2023

Move GetServicesNames() from rpc/util to rpc/net.cpp, as it is only called from that compilation unit and there is no reason for other ones to need it.

Remove the protocol.h include in rpc/util.h, as it was only needed for GetServicesNames(), drop an unneeded forward declaration (the other IWYU suggestions would require more extensive changes in other files), and add 3 already-missing include headers in other translation units that are needed to compile without protocol.h in rpc/util.h, as protocol.h includes netaddress.h, which in turn includes util/strencodings.h.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 24, 2023

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK kevkevinpal, ns-xvrn, achow101

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:

  • #22341 (rpc: add getxpub by Sjors)

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.

@jonatack jonatack force-pushed the 2023-07-move-GetServicesNames-to-its-call-unit branch from 1cff4e1 to 41e8e19 Compare July 24, 2023 03:38
@jonatack jonatack marked this pull request as ready for review July 24, 2023 03:39
@jonatack
Copy link
Member Author

Re the new CI failure, seems an update on master now causes a build error here. Updating.

as it is only called from that compilation unit.

This avoids needlessly compiling GetServicesNames() in the 35 other files that
include rpc/util.h.
@jonatack jonatack force-pushed the 2023-07-move-GetServicesNames-to-its-call-unit branch from 41e8e19 to 2607936 Compare September 19, 2023 21:41
as it was only needed for GetServicesNames(). This potentially avoids needlessly
compiling the 500 lines of protocol.h in the 35 files other than rpc/net.cpp
that include rpc/util.h.

Drop an unneeded CPubKey forward declaration. The other IWYU suggestions would
require more extensive changes in other files.

Add 3 already-missing include headers in other translation units that are needed
to compile without protocol.h in rpc/util.h, as it includes netaddress.h, which
in turn includes util/strencodings.h.
@jonatack jonatack force-pushed the 2023-07-move-GetServicesNames-to-its-call-unit branch from 2607936 to bbb68ff Compare September 19, 2023 21:55
@jonatack
Copy link
Member Author

Rebased and updated. The Win64 CI error is unrelated and documented in issue #28491.

@kevkevinpal
Copy link
Contributor

lgtm ACK bbb68ff

@nsvrn
Copy link
Contributor

nsvrn commented Oct 13, 2023

All unit and functional tests passed locally on my Linux system.
Refactoring makes sense.

ACK bbb68ff

@achow101
Copy link
Member

achow101 commented Nov 7, 2023

ACK bbb68ff

@achow101 achow101 merged commit e773396 into bitcoin:master Nov 7, 2023
@jonatack jonatack deleted the 2023-07-move-GetServicesNames-to-its-call-unit branch November 7, 2023 23:48
@bitcoin bitcoin locked and limited conversation to collaborators Nov 6, 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