Skip to content

Commit 5560682

Browse files
committed
Merge bitcoin/bitcoin#25645: refactor: Remove unused includes from dbwrapper.h
faf98ae Remove unused includes in rpc/fees.cpp (MacroFake) 1111dde Remove unused includes from dbwrapper.h (MacroFake) fa77fdd Add missing includes (MacroFake) fa869ce Add missing includes to node/chainstate (MacroFake) Pull request description: Unused includes are confusing, but also cause unrelated compile errors when the unused includes were to be removed. Fix that by adding the missing includes where they are needed and then remove them where they are not needed. This is also checked by iwyu. ACKs for top commit: hebasto: ACK faf98ae, I have reviewed the code and it looks OK, I agree it can be merged. jarolrod: Code Review ACK bitcoin/bitcoin@faf98ae Tree-SHA512: 75f3c6e6f6ecf8a98233e1a1463c75ca4e0eb3ec341150d274141072fe95413a3c2ec6386d1c527899cc63d43f63f5eb5991509847412773362808ddfb1bb435
2 parents 92c8e18 + faf98ae commit 5560682

File tree

13 files changed

+52
-10
lines changed

13 files changed

+52
-10
lines changed

ci/test/06_script_b.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ if [ "${RUN_TIDY}" = "true" ]; then
4040
export P_CI_DIR="${BASE_BUILD_DIR}/bitcoin-$HOST/"
4141
CI_EXEC "python3 ${DIR_IWYU}/include-what-you-use/iwyu_tool.py"\
4242
" src/compat"\
43+
" src/dbwrapper.cpp"\
4344
" src/init"\
4445
" src/kernel/mempool_persist.cpp"\
46+
" src/node/chainstate.cpp"\
4547
" src/policy/feerate.cpp"\
4648
" src/policy/packages.cpp"\
4749
" src/policy/settings.cpp"\

src/bench/checkblock.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <chainparams.h>
99
#include <consensus/validation.h>
1010
#include <streams.h>
11+
#include <util/system.h>
1112
#include <validation.h>
1213

1314
// These are the two major time-sinks which happen after we have fully received

src/dbwrapper.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,28 @@
44

55
#include <dbwrapper.h>
66

7-
#include <memory>
7+
#include <fs.h>
8+
#include <logging.h>
89
#include <random.h>
10+
#include <tinyformat.h>
11+
#include <util/strencodings.h>
12+
#include <util/system.h>
913

14+
#include <algorithm>
15+
#include <cassert>
16+
#include <cstdarg>
17+
#include <cstdint>
18+
#include <cstdio>
1019
#include <leveldb/cache.h>
20+
#include <leveldb/db.h>
1121
#include <leveldb/env.h>
1222
#include <leveldb/filter_policy.h>
1323
#include <leveldb/helpers/memenv/memenv.h>
14-
#include <stdint.h>
15-
#include <algorithm>
24+
#include <leveldb/iterator.h>
25+
#include <leveldb/options.h>
26+
#include <leveldb/status.h>
27+
#include <memory>
28+
#include <optional>
1629

1730
class CBitcoinLevelDBLogger : public leveldb::Logger {
1831
public:

src/dbwrapper.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,26 @@
77

88
#include <clientversion.h>
99
#include <fs.h>
10+
#include <logging.h>
1011
#include <serialize.h>
1112
#include <span.h>
1213
#include <streams.h>
13-
#include <util/strencodings.h>
14-
#include <util/system.h>
1514

15+
#include <cstddef>
16+
#include <cstdint>
17+
#include <exception>
1618
#include <leveldb/db.h>
19+
#include <leveldb/iterator.h>
20+
#include <leveldb/options.h>
21+
#include <leveldb/slice.h>
22+
#include <leveldb/status.h>
1723
#include <leveldb/write_batch.h>
24+
#include <stdexcept>
25+
#include <string>
26+
#include <vector>
27+
namespace leveldb {
28+
class Env;
29+
}
1830

1931
static const size_t DBWRAPPER_PREALLOC_KEY_SIZE = 64;
2032
static const size_t DBWRAPPER_PREALLOC_VALUE_SIZE = 1024;

src/index/base.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <shutdown.h>
1313
#include <tinyformat.h>
1414
#include <util/syscall_sandbox.h>
15+
#include <util/system.h>
1516
#include <util/thread.h>
1617
#include <util/translation.h>
1718
#include <validation.h> // For g_chainman

src/index/coinstatsindex.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <serialize.h>
1111
#include <txdb.h>
1212
#include <undo.h>
13+
#include <util/system.h>
1314
#include <validation.h>
1415

1516
using kernel::CCoinsStats;

src/node/chainstate.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@
44

55
#include <node/chainstate.h>
66

7+
#include <chain.h>
8+
#include <coins.h>
79
#include <consensus/params.h>
810
#include <node/blockstorage.h>
11+
#include <sync.h>
12+
#include <threadsafety.h>
13+
#include <txdb.h>
14+
#include <uint256.h>
15+
#include <util/time.h>
916
#include <validation.h>
1017

18+
#include <algorithm>
19+
#include <atomic>
20+
#include <cassert>
21+
#include <memory>
22+
#include <vector>
23+
1124
namespace node {
1225
std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
1326
ChainstateManager& chainman,

src/node/chainstate.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111

1212
class ChainstateManager;
1313
class CTxMemPool;
14-
namespace Consensus {
15-
struct Params;
16-
} // namespace Consensus
1714

1815
namespace node {
1916
enum class ChainstateLoadingError {

src/qt/optionsdialog.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <validation.h> // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS
2020
#include <netbase.h>
2121
#include <txdb.h> // for -dbcache defaults
22+
#include <util/system.h>
2223

2324
#include <chrono>
2425

src/rpc/blockchain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <univalue.h>
4040
#include <util/check.h>
4141
#include <util/strencodings.h>
42+
#include <util/system.h>
4243
#include <util/translation.h>
4344
#include <validation.h>
4445
#include <validationinterface.h>

0 commit comments

Comments
 (0)