Skip to content

Commit fa62868

Browse files
author
MarcoFalke
committed
Remove unused includes from wallet.cpp
This removes unused includes, such as undo.h or txmempool.h from wallet.cpp. Also, add missing ones, according to IWYU.
1 parent fa8fdbe commit fa62868

File tree

3 files changed

+78
-25
lines changed

3 files changed

+78
-25
lines changed

src/wallet/wallet.cpp

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,82 @@
55

66
#include <wallet/wallet.h>
77

8+
#if defined(HAVE_CONFIG_H)
9+
#include <config/bitcoin-config.h>
10+
#endif
11+
#include <addresstype.h>
812
#include <blockfilter.h>
913
#include <chain.h>
14+
#include <coins.h>
1015
#include <common/args.h>
16+
#include <common/settings.h>
17+
#include <common/system.h>
1118
#include <consensus/amount.h>
1219
#include <consensus/consensus.h>
1320
#include <consensus/validation.h>
1421
#include <external_signer.h>
1522
#include <interfaces/chain.h>
23+
#include <interfaces/handler.h>
1624
#include <interfaces/wallet.h>
25+
#include <kernel/mempool_removal_reason.h>
1726
#include <key.h>
1827
#include <key_io.h>
28+
#include <logging.h>
1929
#include <outputtype.h>
20-
#include <policy/fees.h>
21-
#include <policy/policy.h>
30+
#include <policy/feerate.h>
2231
#include <primitives/block.h>
2332
#include <primitives/transaction.h>
2433
#include <psbt.h>
34+
#include <pubkey.h>
2535
#include <random.h>
2636
#include <script/descriptor.h>
37+
#include <script/interpreter.h>
2738
#include <script/script.h>
39+
#include <script/sign.h>
2840
#include <script/signingprovider.h>
2941
#include <script/solver.h>
42+
#include <serialize.h>
43+
#include <span.h>
44+
#include <streams.h>
45+
#include <support/allocators/secure.h>
46+
#include <support/allocators/zeroafterfree.h>
3047
#include <support/cleanse.h>
31-
#include <txmempool.h>
32-
#include <util/bip32.h>
48+
#include <sync.h>
49+
#include <tinyformat.h>
50+
#include <uint256.h>
51+
#include <univalue.h>
3352
#include <util/check.h>
3453
#include <util/error.h>
35-
#include <util/fees.h>
3654
#include <util/fs.h>
3755
#include <util/fs_helpers.h>
56+
#include <util/message.h>
3857
#include <util/moneystr.h>
39-
#include <util/rbf.h>
58+
#include <util/result.h>
4059
#include <util/string.h>
60+
#include <util/time.h>
4161
#include <util/translation.h>
4262
#include <wallet/coincontrol.h>
4363
#include <wallet/context.h>
64+
#include <wallet/crypter.h>
65+
#include <wallet/db.h>
4466
#include <wallet/external_signer_scriptpubkeyman.h>
45-
#include <wallet/fees.h>
4667
#include <wallet/scriptpubkeyman.h>
47-
48-
#include <univalue.h>
68+
#include <wallet/transaction.h>
69+
#include <wallet/types.h>
70+
#include <wallet/walletdb.h>
71+
#include <wallet/walletutil.h>
4972

5073
#include <algorithm>
51-
#include <assert.h>
74+
#include <cassert>
75+
#include <condition_variable>
76+
#include <exception>
5277
#include <optional>
78+
#include <stdexcept>
79+
#include <thread>
80+
#include <tuple>
81+
#include <variant>
82+
83+
struct KeyOriginInfo;
5384

5485
using interfaces::FoundBlock;
5586

src/wallet/wallet.h

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,72 @@
1010
#include <consensus/amount.h>
1111
#include <interfaces/chain.h>
1212
#include <interfaces/handler.h>
13-
#include <interfaces/wallet.h>
13+
#include <kernel/cs_main.h>
1414
#include <logging.h>
1515
#include <outputtype.h>
1616
#include <policy/feerate.h>
17-
#include <psbt.h>
17+
#include <primitives/transaction.h>
18+
#include <script/interpreter.h>
19+
#include <script/script.h>
20+
#include <support/allocators/secure.h>
21+
#include <sync.h>
1822
#include <tinyformat.h>
23+
#include <uint256.h>
1924
#include <util/fs.h>
2025
#include <util/hasher.h>
21-
#include <util/message.h>
2226
#include <util/result.h>
23-
#include <util/strencodings.h>
2427
#include <util/string.h>
2528
#include <util/time.h>
2629
#include <util/ui_change_type.h>
27-
#include <validationinterface.h>
2830
#include <wallet/crypter.h>
31+
#include <wallet/db.h>
2932
#include <wallet/scriptpubkeyman.h>
3033
#include <wallet/transaction.h>
31-
#include <wallet/walletdb.h>
34+
#include <wallet/types.h>
3235
#include <wallet/walletutil.h>
3336

34-
#include <algorithm>
3537
#include <atomic>
38+
#include <cassert>
39+
#include <cstddef>
40+
#include <cstdint>
41+
#include <functional>
42+
#include <limits>
3643
#include <map>
3744
#include <memory>
3845
#include <optional>
3946
#include <set>
40-
#include <stdexcept>
41-
#include <stdint.h>
4247
#include <string>
43-
#include <utility>
4448
#include <unordered_map>
49+
#include <utility>
4550
#include <vector>
4651

4752
#include <boost/signals2/signal.hpp>
4853

54+
class CKey;
55+
class CKeyID;
56+
class CPubKey;
57+
class Coin;
58+
class SigningProvider;
59+
enum class MemPoolRemovalReason;
60+
enum class SigningResult;
61+
enum class TransactionError;
62+
namespace interfaces {
63+
class Wallet;
64+
}
65+
namespace wallet {
66+
class CWallet;
67+
class WalletBatch;
68+
enum class DBErrors : int;
69+
} // namespace wallet
70+
struct CBlockLocator;
71+
struct CExtKey;
72+
struct FlatSigningProvider;
73+
struct KeyOriginInfo;
74+
struct PartiallySignedTransaction;
75+
struct SignatureData;
4976

5077
using LoadWalletFn = std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>;
5178

52-
class CScript;
53-
enum class FeeEstimateMode;
5479
struct bilingual_str;
5580

5681
namespace wallet {
@@ -119,8 +144,6 @@ constexpr CAmount HIGH_MAX_TX_FEE{100 * HIGH_TX_FEE_PER_KB};
119144
static constexpr size_t DUMMY_NESTED_P2WPKH_INPUT_SIZE = 91;
120145

121146
class CCoinControl;
122-
class CWalletTx;
123-
class ReserveDestination;
124147

125148
//! Default for -addresstype
126149
constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::BECH32};

test/lint/lint-circular-dependencies.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"qt/recentrequeststablemodel -> qt/walletmodel -> qt/recentrequeststablemodel",
2020
"qt/sendcoinsdialog -> qt/walletmodel -> qt/sendcoinsdialog",
2121
"qt/transactiontablemodel -> qt/walletmodel -> qt/transactiontablemodel",
22-
"wallet/fees -> wallet/wallet -> wallet/fees",
2322
"wallet/wallet -> wallet/walletdb -> wallet/wallet",
2423
"kernel/coinstats -> validation -> kernel/coinstats",
2524
"kernel/mempool_persist -> validation -> kernel/mempool_persist",

0 commit comments

Comments
 (0)