From f23f9a03c86f789ab41d75b91f75393e3156ec39 Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 14:30:15 -0500 Subject: [PATCH 1/8] Only include irc.h when needed --- src/headers.h | 1 - src/irc.cpp | 1 + src/net.cpp | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index d40c5ed0..7cc6d3b9 100644 --- a/src/headers.h +++ b/src/headers.h @@ -120,7 +120,6 @@ #include "script.h" #include "db.h" #include "net.h" -#include "irc.h" #include "main.h" #include "rpc.h" #ifdef GUI diff --git a/src/irc.cpp b/src/irc.cpp index 099d9e07..b2455463 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "irc.h" using namespace std; using namespace boost; diff --git a/src/net.cpp b/src/net.cpp index 1320781c..3339b771 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "irc.h" #ifdef USE_UPNP #include From 1512d5ce64b9a53260f5aa695bc79a0e48d6294f Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 15:57:34 -0500 Subject: [PATCH 2/8] Only include db.h when we have to. --- src/db.cpp | 1 + src/headers.h | 1 - src/init.cpp | 1 + src/main.cpp | 1 + src/main.h | 3 +++ src/net.cpp | 1 + src/rpc.cpp | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/db.cpp b/src/db.cpp index 52c0f5b4..7152033c 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "db.h" using namespace std; using namespace boost; diff --git a/src/headers.h b/src/headers.h index 7cc6d3b9..2d309f95 100644 --- a/src/headers.h +++ b/src/headers.h @@ -118,7 +118,6 @@ #include "bignum.h" #include "base58.h" #include "script.h" -#include "db.h" #include "net.h" #include "main.h" #include "rpc.h" diff --git a/src/init.cpp b/src/init.cpp index 431c533a..14f4904f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "db.h" using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index 68b6b4ee..dda366a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "db.h" #include "cryptopp/sha.h" using namespace std; diff --git a/src/main.h b/src/main.h index 92b73fe5..41177734 100644 --- a/src/main.h +++ b/src/main.h @@ -77,6 +77,9 @@ extern int fUseUPnP; +class CReserveKey; +class CTxDB; +class CTxIndex; bool CheckDiskSpace(uint64 nAdditionalBytes=0); diff --git a/src/net.cpp b/src/net.cpp index 3339b771..7a1c137c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "irc.h" +#include "db.h" #ifdef USE_UPNP #include diff --git a/src/rpc.cpp b/src/rpc.cpp index 9efcbbb1..e826d0b4 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "cryptopp/sha.h" +#include "db.h" #undef printf #include #include From ed0c143242d734365b0e3d09b0e52e07819ffcdd Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 16:10:07 -0500 Subject: [PATCH 3/8] Only included rpc.h when necessary --- src/headers.h | 1 - src/init.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index 2d309f95..ee10c53e 100644 --- a/src/headers.h +++ b/src/headers.h @@ -120,7 +120,6 @@ #include "script.h" #include "net.h" #include "main.h" -#include "rpc.h" #ifdef GUI #include "uibase.h" #include "ui.h" diff --git a/src/init.cpp b/src/init.cpp index 14f4904f..b12c5eec 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "db.h" +#include "rpc.h" using namespace std; using namespace boost; From 40c2614ef43a59ec0c8dc4338bbe27862243f2bb Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 16:20:30 -0500 Subject: [PATCH 4/8] Only include net.h when we have to --- src/db.cpp | 1 + src/headers.h | 1 - src/init.cpp | 1 + src/irc.cpp | 1 + src/main.cpp | 1 + src/main.h | 7 +++++++ src/net.cpp | 1 + src/rpc.cpp | 1 + 8 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/db.cpp b/src/db.cpp index 7152033c..b3ce00a0 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "db.h" +#include "net.h" using namespace std; using namespace boost; diff --git a/src/headers.h b/src/headers.h index ee10c53e..67165c46 100644 --- a/src/headers.h +++ b/src/headers.h @@ -118,7 +118,6 @@ #include "bignum.h" #include "base58.h" #include "script.h" -#include "net.h" #include "main.h" #ifdef GUI #include "uibase.h" diff --git a/src/init.cpp b/src/init.cpp index b12c5eec..149110f4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "db.h" #include "rpc.h" +#include "net.h" using namespace std; using namespace boost; diff --git a/src/irc.cpp b/src/irc.cpp index b2455463..5c9e0a96 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "irc.h" +#include "net.h" using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index dda366a1..5c6cb678 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "db.h" +#include "net.h" #include "cryptopp/sha.h" using namespace std; diff --git a/src/main.h b/src/main.h index 41177734..33c48927 100644 --- a/src/main.h +++ b/src/main.h @@ -24,6 +24,13 @@ class CBlockIndex; class CWalletTx; class CKeyItem; +class CMessageHeader; +class CAddress; +class CInv; +class CRequestTracker; +class CNode; +class CBlockIndex; + static const unsigned int MAX_BLOCK_SIZE = 1000000; static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2; static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; diff --git a/src/net.cpp b/src/net.cpp index 7a1c137c..60a91dff 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "irc.h" #include "db.h" +#include "net.h" #ifdef USE_UPNP #include diff --git a/src/rpc.cpp b/src/rpc.cpp index e826d0b4..9ab7710a 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "cryptopp/sha.h" #include "db.h" +#include "net.h" #undef printf #include #include From edd309e5373022f9737cb97b7f38872e46a53cd4 Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 15 May 2011 16:52:31 -0500 Subject: [PATCH 5/8] Only include init.h when we have to --- src/headers.h | 1 - src/init.cpp | 1 + src/main.cpp | 1 + src/net.cpp | 1 + src/rpc.cpp | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index 67165c46..3665e584 100644 --- a/src/headers.h +++ b/src/headers.h @@ -125,7 +125,6 @@ #else #include "noui.h" #endif -#include "init.h" #ifdef GUI #include "xpm/addressbook16.xpm" diff --git a/src/init.cpp b/src/init.cpp index 149110f4..3eab8e1c 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -5,6 +5,7 @@ #include "db.h" #include "rpc.h" #include "net.h" +#include "init.h" using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index 5c6cb678..18f36eb3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,6 +4,7 @@ #include "headers.h" #include "db.h" #include "net.h" +#include "init.h" #include "cryptopp/sha.h" using namespace std; diff --git a/src/net.cpp b/src/net.cpp index 60a91dff..51d29022 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -6,6 +6,7 @@ #include "irc.h" #include "db.h" #include "net.h" +#include "init.h" #ifdef USE_UPNP #include diff --git a/src/rpc.cpp b/src/rpc.cpp index 9ab7710a..8731b6d5 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -6,6 +6,7 @@ #include "cryptopp/sha.h" #include "db.h" #include "net.h" +#include "init.h" #undef printf #include #include From fdd7d047443b3f4ce1e4433ec28289a11ba4a94b Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 15 May 2011 17:08:35 -0500 Subject: [PATCH 6/8] Only include strlcpy.h when we have to --- src/headers.h | 1 - src/init.cpp | 1 + src/irc.cpp | 1 + src/net.cpp | 1 + src/util.cpp | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/headers.h b/src/headers.h index 3665e584..785d5bcf 100644 --- a/src/headers.h +++ b/src/headers.h @@ -110,7 +110,6 @@ #pragma hdrstop -#include "strlcpy.h" #include "serialize.h" #include "uint256.h" #include "util.h" diff --git a/src/init.cpp b/src/init.cpp index 3eab8e1c..a94ea9b7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -6,6 +6,7 @@ #include "rpc.h" #include "net.h" #include "init.h" +#include "strlcpy.h" using namespace std; using namespace boost; diff --git a/src/irc.cpp b/src/irc.cpp index 5c9e0a96..a262eaba 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "irc.h" #include "net.h" +#include "strlcpy.h" using namespace std; using namespace boost; diff --git a/src/net.cpp b/src/net.cpp index 51d29022..2d896271 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -7,6 +7,7 @@ #include "db.h" #include "net.h" #include "init.h" +#include "strlcpy.h" #ifdef USE_UPNP #include diff --git a/src/util.cpp b/src/util.cpp index 4e93f625..1b6ba016 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT/X11 software license, see the accompanying // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "strlcpy.h" using namespace std; using namespace boost; From 6b783965c4c9dbce3c782f3f70b7b6342b7e56da Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sat, 14 May 2011 14:29:54 -0500 Subject: [PATCH 7/8] Remove some globally unused headers from headers.h --- src/headers.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/headers.h b/src/headers.h index 785d5bcf..a242c9c1 100644 --- a/src/headers.h +++ b/src/headers.h @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include @@ -56,14 +55,8 @@ #include #include #include -#include -#include -#include + #include -#include -#include -#include -#include #include #include #include @@ -74,9 +67,6 @@ #include #include #include -#include -#include -#include #include #include From 31f293128177e0f53331ddb3f1f5ea22176bf91c Mon Sep 17 00:00:00 2001 From: Jordan Lewis Date: Sun, 15 May 2011 22:45:35 -0500 Subject: [PATCH 8/8] Only include certain boost headers if necessary. --- src/db.cpp | 1 + src/headers.h | 12 ------------ src/init.cpp | 2 ++ src/main.cpp | 1 + src/rpc.cpp | 2 ++ src/ui.cpp | 4 ++++ src/util.cpp | 6 ++++++ src/util.h | 1 - 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index b3ce00a0..0e552229 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -5,6 +5,7 @@ #include "headers.h" #include "db.h" #include "net.h" +#include using namespace std; using namespace boost; diff --git a/src/headers.h b/src/headers.h index a242c9c1..9e81e27d 100644 --- a/src/headers.h +++ b/src/headers.h @@ -57,18 +57,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #ifdef __WXMSW__ #include diff --git a/src/init.cpp b/src/init.cpp index a94ea9b7..73f4e207 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -7,6 +7,8 @@ #include "net.h" #include "init.h" #include "strlcpy.h" +#include +#include using namespace std; using namespace boost; diff --git a/src/main.cpp b/src/main.cpp index 18f36eb3..0ecbeafd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include "net.h" #include "init.h" #include "cryptopp/sha.h" +#include using namespace std; using namespace boost; diff --git a/src/rpc.cpp b/src/rpc.cpp index 8731b6d5..b05a13e2 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -11,8 +11,10 @@ #include #include #include +#include #ifdef USE_SSL #include +#include typedef boost::asio::ssl::stream SSLStream; #endif #include "json/json_spirit_reader_template.h" diff --git a/src/ui.cpp b/src/ui.cpp index 6e28435a..f24449cc 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -3,6 +3,10 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" +#include "init.h" +#include "strlcpy.h" +#include +#include #ifdef _MSC_VER #include #endif diff --git a/src/util.cpp b/src/util.cpp index 1b6ba016..32f4b27f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3,6 +3,12 @@ // file license.txt or http://www.opensource.org/licenses/mit-license.php. #include "headers.h" #include "strlcpy.h" +#include +#include +#include +#include +#include +#include using namespace std; using namespace boost; diff --git a/src/util.h b/src/util.h index e4bf0fb1..32445951 100644 --- a/src/util.h +++ b/src/util.h @@ -15,7 +15,6 @@ #include #include -#include #include #include #include