Skip to content

Commit bbb68ff

Browse files
committed
refactor: drop protocol.h include header in rpc/util.h
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.
1 parent 1dd62c5 commit bbb68ff

File tree

4 files changed

+3
-2
lines changed

4 files changed

+3
-2
lines changed

src/httprpc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <crypto/hmac_sha256.h>
99
#include <httpserver.h>
1010
#include <logging.h>
11+
#include <netaddress.h>
1112
#include <rpc/protocol.h>
1213
#include <rpc/server.h>
1314
#include <util/strencodings.h>

src/rest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <txmempool.h>
2727
#include <util/any.h>
2828
#include <util/check.h>
29+
#include <util/strencodings.h>
2930
#include <validation.h>
3031
#include <version.h>
3132

src/rpc/mempool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <univalue.h>
2222
#include <util/fs.h>
2323
#include <util/moneystr.h>
24+
#include <util/strencodings.h>
2425
#include <util/time.h>
2526

2627
#include <utility>

src/rpc/util.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <consensus/amount.h>
1010
#include <node/transaction.h>
1111
#include <outputtype.h>
12-
#include <protocol.h>
1312
#include <pubkey.h>
1413
#include <rpc/protocol.h>
1514
#include <rpc/request.h>
@@ -59,7 +58,6 @@ extern const std::string UNIX_EPOCH_TIME;
5958
extern const std::string EXAMPLE_ADDRESS[2];
6059

6160
class FillableSigningProvider;
62-
class CPubKey;
6361
class CScript;
6462
struct Sections;
6563

0 commit comments

Comments
 (0)