Skip to content

Commit

Permalink
Merge #16659: refactoring: Remove unused includes
Browse files Browse the repository at this point in the history
084e17c Remove unused includes (practicalswift)

Pull request description:

  As requested by MarcoFalke in #16273 (comment):

  This PR removes unused includes.

  Please note that in contrast to #16273 I'm limiting the scope to the trivial cases of pure removals (i.e. no includes added) to make reviewing easier.

  I'm seeking "Concept ACK":s for this obviously non-urgent minor cleanup.

  Rationale:
  * Avoids unnecessary re-compiles in case of header changes.
  * Makes reasoning about code dependencies easier.
  * Reduces compile-time memory usage.
  * Reduces compilation time.
  * Warm fuzzy feeling of being lean :-)

ACKs for top commit:
  ryanofsky:
    Code review ACK 084e17c. PR only removes include lines and it still compiles. In the worst case someone might have to explicitly add an include later for something now included implicitly. But maybe some effort was taken to avoid this, and it wouldn't be a tragedy anyway.

Tree-SHA512: 89de56edc6ceea4696e9579bccff10c80080821685b9fb4e8c5ef593b6e43cf662f358788701bb09f84867693f66b2e4db035b92b522a0a775f50b7ecffd6a6d
  • Loading branch information
MarcoFalke committed Oct 16, 2019
2 parents c34b886 + 084e17c commit 46d6930
Show file tree
Hide file tree
Showing 119 changed files with 0 additions and 159 deletions.
2 changes: 0 additions & 2 deletions src/arith_uint256.cpp
Expand Up @@ -8,8 +8,6 @@
#include <uint256.h>
#include <crypto/common.h>

#include <stdio.h>
#include <string.h>

template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string& str)
Expand Down
2 changes: 0 additions & 2 deletions src/arith_uint256.h
Expand Up @@ -6,13 +6,11 @@
#ifndef BITCOIN_ARITH_UINT256_H
#define BITCOIN_ARITH_UINT256_H

#include <assert.h>
#include <cstring>
#include <limits>
#include <stdexcept>
#include <stdint.h>
#include <string>
#include <vector>

class uint256;

Expand Down
1 change: 0 additions & 1 deletion src/bench/base58.cpp
Expand Up @@ -8,7 +8,6 @@

#include <array>
#include <vector>
#include <string>


static void Base58Encode(benchmark::State& state)
Expand Down
1 change: 0 additions & 1 deletion src/bench/bench.h
Expand Up @@ -6,7 +6,6 @@
#define BITCOIN_BENCH_BENCH_H

#include <functional>
#include <limits>
#include <map>
#include <string>
#include <vector>
Expand Down
1 change: 0 additions & 1 deletion src/bench/block_assemble.cpp
Expand Up @@ -10,7 +10,6 @@
#include <validation.h>


#include <list>
#include <vector>

static void AssembleBlock(benchmark::State& state)
Expand Down
1 change: 0 additions & 1 deletion src/bench/chacha20.cpp
Expand Up @@ -2,7 +2,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <iostream>

#include <bench/bench.h>
#include <crypto/chacha20.h>
Expand Down
1 change: 0 additions & 1 deletion src/bench/chacha_poly_aead.cpp
Expand Up @@ -2,7 +2,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <iostream>

#include <bench/bench.h>
#include <crypto/chacha_poly_aead.h>
Expand Down
1 change: 0 additions & 1 deletion src/bench/crypto_hash.cpp
Expand Up @@ -2,7 +2,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <iostream>

#include <bench/bench.h>
#include <hash.h>
Expand Down
3 changes: 0 additions & 3 deletions src/bench/duplicate_inputs.cpp
Expand Up @@ -4,15 +4,12 @@

#include <bench/bench.h>
#include <chainparams.h>
#include <coins.h>
#include <consensus/merkle.h>
#include <consensus/validation.h>
#include <pow.h>
#include <txmempool.h>
#include <validation.h>

#include <list>
#include <vector>


static void DuplicateInputs(benchmark::State& state)
Expand Down
1 change: 0 additions & 1 deletion src/bench/lockedpool.cpp
Expand Up @@ -6,7 +6,6 @@

#include <support/lockedpool.h>

#include <iostream>
#include <vector>

#define ASIZE 2048
Expand Down
2 changes: 0 additions & 2 deletions src/bench/mempool_eviction.cpp
Expand Up @@ -6,8 +6,6 @@
#include <policy/policy.h>
#include <txmempool.h>

#include <list>
#include <vector>

static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs)
{
Expand Down
1 change: 0 additions & 1 deletion src/bench/poly1305.cpp
Expand Up @@ -2,7 +2,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <iostream>

#include <bench/bench.h>
#include <crypto/poly1305.h>
Expand Down
1 change: 0 additions & 1 deletion src/bench/rollingbloom.cpp
Expand Up @@ -2,7 +2,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <iostream>

#include <bench/bench.h>
#include <bloom.h>
Expand Down
1 change: 0 additions & 1 deletion src/bench/rpc_blockchain.cpp
Expand Up @@ -7,7 +7,6 @@

#include <validation.h>
#include <streams.h>
#include <consensus/validation.h>
#include <rpc/blockchain.h>

#include <univalue.h>
Expand Down
2 changes: 0 additions & 2 deletions src/bench/rpc_mempool.cpp
Expand Up @@ -8,8 +8,6 @@

#include <univalue.h>

#include <list>
#include <vector>

static void AddTx(const CTransactionRef& tx, const CAmount& fee, CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs)
{
Expand Down
1 change: 0 additions & 1 deletion src/bitcoin-cli.cpp
Expand Up @@ -9,7 +9,6 @@

#include <chainparamsbase.h>
#include <clientversion.h>
#include <fs.h>
#include <rpc/client.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
Expand Down
1 change: 0 additions & 1 deletion src/bitcoin-tx.cpp
Expand Up @@ -11,7 +11,6 @@
#include <consensus/consensus.h>
#include <core_io.h>
#include <key_io.h>
#include <policy/policy.h>
#include <policy/rbf.h>
#include <primitives/transaction.h>
#include <script/script.h>
Expand Down
2 changes: 0 additions & 2 deletions src/bitcoin-wallet.cpp
Expand Up @@ -9,13 +9,11 @@
#include <chainparams.h>
#include <chainparamsbase.h>
#include <logging.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <wallet/wallettool.h>

#include <functional>
#include <stdio.h>

const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;

Expand Down
1 change: 0 additions & 1 deletion src/bitcoind.cpp
Expand Up @@ -10,7 +10,6 @@
#include <chainparams.h>
#include <clientversion.h>
#include <compat.h>
#include <fs.h>
#include <init.h>
#include <interfaces/chain.h>
#include <noui.h>
Expand Down
1 change: 0 additions & 1 deletion src/blockencodings.h
Expand Up @@ -7,7 +7,6 @@

#include <primitives/block.h>

#include <memory>

class CTxMemPool;

Expand Down
1 change: 0 additions & 1 deletion src/compressor.cpp
Expand Up @@ -5,7 +5,6 @@

#include <compressor.h>

#include <hash.h>
#include <pubkey.h>
#include <script/standard.h>

Expand Down
2 changes: 0 additions & 2 deletions src/consensus/merkle.h
Expand Up @@ -5,10 +5,8 @@
#ifndef BITCOIN_CONSENSUS_MERKLE_H
#define BITCOIN_CONSENSUS_MERKLE_H

#include <stdint.h>
#include <vector>

#include <primitives/transaction.h>
#include <primitives/block.h>
#include <uint256.h>

Expand Down
2 changes: 0 additions & 2 deletions src/consensus/params.h
Expand Up @@ -8,8 +8,6 @@

#include <uint256.h>
#include <limits>
#include <map>
#include <string>

namespace Consensus {

Expand Down
1 change: 0 additions & 1 deletion src/crypto/aes.cpp
Expand Up @@ -4,7 +4,6 @@

#include <crypto/aes.h>

#include <assert.h>
#include <string.h>

extern "C" {
Expand Down
1 change: 0 additions & 1 deletion src/crypto/chacha_poly_aead.cpp
Expand Up @@ -4,7 +4,6 @@

#include <crypto/chacha_poly_aead.h>

#include <crypto/common.h>
#include <crypto/poly1305.h>
#include <support/cleanse.h>

Expand Down
1 change: 0 additions & 1 deletion src/crypto/sha256.cpp
Expand Up @@ -7,7 +7,6 @@

#include <assert.h>
#include <string.h>
#include <atomic>

#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
#if defined(USE_ASM)
Expand Down
1 change: 0 additions & 1 deletion src/crypto/sha256_shani.cpp
Expand Up @@ -11,7 +11,6 @@
#include <stdint.h>
#include <immintrin.h>

#include <crypto/common.h>


namespace {
Expand Down
1 change: 0 additions & 1 deletion src/dbwrapper.h
Expand Up @@ -11,7 +11,6 @@
#include <streams.h>
#include <util/system.h>
#include <util/strencodings.h>
#include <version.h>

#include <leveldb/db.h>
#include <leveldb/write_batch.h>
Expand Down
1 change: 0 additions & 1 deletion src/dummywallet.cpp
Expand Up @@ -2,7 +2,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include <stdio.h>
#include <util/system.h>
#include <walletinitinterface.h>
#include <support/allocators/secure.h>
Expand Down
2 changes: 0 additions & 2 deletions src/httprpc.cpp
Expand Up @@ -7,10 +7,8 @@
#include <chainparams.h>
#include <crypto/hmac_sha256.h>
#include <httpserver.h>
#include <key_io.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <sync.h>
#include <ui_interface.h>
#include <util/strencodings.h>
#include <util/system.h>
Expand Down
2 changes: 0 additions & 2 deletions src/httprpc.h
Expand Up @@ -5,8 +5,6 @@
#ifndef BITCOIN_HTTPRPC_H
#define BITCOIN_HTTPRPC_H

#include <string>
#include <map>

/** Start HTTP RPC subsystem.
* Precondition; HTTP and RPC has been started.
Expand Down
1 change: 0 additions & 1 deletion src/httpserver.cpp
Expand Up @@ -22,7 +22,6 @@

#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>

#include <event2/thread.h>
#include <event2/buffer.h>
Expand Down
1 change: 0 additions & 1 deletion src/httpserver.h
Expand Up @@ -6,7 +6,6 @@
#define BITCOIN_HTTPSERVER_H

#include <string>
#include <stdint.h>
#include <functional>

static const int DEFAULT_HTTP_THREADS=4;
Expand Down
1 change: 0 additions & 1 deletion src/index/base.h
Expand Up @@ -9,7 +9,6 @@
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <threadinterrupt.h>
#include <uint256.h>
#include <validationinterface.h>

class CBlockIndex;
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/chain.cpp
Expand Up @@ -18,12 +18,10 @@
#include <policy/settings.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <protocol.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <shutdown.h>
#include <sync.h>
#include <threadsafety.h>
#include <timedata.h>
#include <txmempool.h>
#include <ui_interface.h>
Expand Down
3 changes: 0 additions & 3 deletions src/interfaces/node.cpp
Expand Up @@ -5,7 +5,6 @@
#include <interfaces/node.h>

#include <addrdb.h>
#include <amount.h>
#include <banman.h>
#include <chain.h>
#include <chainparams.h>
Expand All @@ -19,7 +18,6 @@
#include <netbase.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <policy/policy.h>
#include <policy/settings.h>
#include <primitives/block.h>
#include <rpc/server.h>
Expand All @@ -36,7 +34,6 @@
#include <config/bitcoin-config.h>
#endif

#include <atomic>
#include <univalue.h>

class CWallet;
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/wallet.cpp
Expand Up @@ -8,7 +8,6 @@
#include <consensus/validation.h>
#include <interfaces/chain.h>
#include <interfaces/handler.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <primitives/transaction.h>
#include <script/standard.h>
Expand All @@ -23,7 +22,6 @@
#include <wallet/rpcwallet.h>
#include <wallet/load.h>
#include <wallet/wallet.h>
#include <wallet/walletutil.h>

#include <memory>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion src/key_io.cpp
Expand Up @@ -6,7 +6,6 @@

#include <base58.h>
#include <bech32.h>
#include <script/script.h>
#include <util/strencodings.h>

#include <boost/variant/apply_visitor.hpp>
Expand Down
2 changes: 0 additions & 2 deletions src/miner.cpp
Expand Up @@ -17,14 +17,12 @@
#include <policy/policy.h>
#include <pow.h>
#include <primitives/transaction.h>
#include <script/standard.h>
#include <timedata.h>
#include <util/moneystr.h>
#include <util/system.h>
#include <util/validation.h>

#include <algorithm>
#include <queue>
#include <utility>

int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
Expand Down
3 changes: 0 additions & 3 deletions src/net.cpp
Expand Up @@ -13,11 +13,9 @@
#include <chainparams.h>
#include <clientversion.h>
#include <consensus/consensus.h>
#include <crypto/common.h>
#include <crypto/sha256.h>
#include <netbase.h>
#include <net_permissions.h>
#include <primitives/transaction.h>
#include <scheduler.h>
#include <ui_interface.h>
#include <util/strencodings.h>
Expand All @@ -35,7 +33,6 @@

#ifdef USE_UPNP
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/miniwget.h>
#include <miniupnpc/upnpcommands.h>
#include <miniupnpc/upnperrors.h>
// The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
Expand Down

0 comments on commit 46d6930

Please sign in to comment.