From bbb68ffdbdafb6717dcadac074f6098750b8aa77 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 23 Jul 2023 20:45:10 -0600 Subject: [PATCH] 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. --- src/httprpc.cpp | 1 + src/rest.cpp | 1 + src/rpc/mempool.cpp | 1 + src/rpc/util.h | 2 -- 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 661406e122c..c72dbf10bc9 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/src/rest.cpp b/src/rest.cpp index ba149c1a9ec..69a8d5effd8 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp index 377e9de0e84..bcc58fe1a6d 100644 --- a/src/rpc/mempool.cpp +++ b/src/rpc/mempool.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/src/rpc/util.h b/src/rpc/util.h index 663ae34d8bf..609ec32818d 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -59,7 +58,6 @@ extern const std::string UNIX_EPOCH_TIME; extern const std::string EXAMPLE_ADDRESS[2]; class FillableSigningProvider; -class CPubKey; class CScript; struct Sections;