Skip to content

Commit

Permalink
Merge bitcoin#10574: Remove includes in .cpp files for things the cor…
Browse files Browse the repository at this point in the history
…responding .h file already included

a720b92 Remove includes in .cpp files for things the corresponding .h file already included (practicalswift)

Pull request description:

  Remove includes in .cpp files for things the corresponding .h file already included.

  Example case:
  * `addrdb.cpp` includes `addrdb.h` and `fs.h`
  * `addrdb.h` includes `fs.h`

  Then remove the direct inclusion of `fs.h` in `addrman.cpp` and rely on the indirect inclusion of `fs.h` via the included `addrdb.h`.

  In line with the header include guideline (see bitcoin#10575).

Tree-SHA512: 8704b9de3011a4c234db336a39f7d2c139e741cf0f7aef08a5d3e05197e1e18286b863fdab25ae9638af4ff86b3d52e5cab9eed66bfa2476063aa5c79f9b0346
  • Loading branch information
laanwj authored and PastaPastaPasta committed Apr 1, 2020
1 parent a7a3ecc commit fe8c18c
Show file tree
Hide file tree
Showing 37 changed files with 0 additions and 74 deletions.
1 change: 0 additions & 1 deletion src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <fs.h>
#include <hash.h>
#include <random.h>
#include <streams.h>
Expand Down
1 change: 0 additions & 1 deletion src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <chainparams.h>
#include <reverse_iterator.h>
#include <validation.h>
#include <uint256.h>

#include <stdint.h>

Expand Down
1 change: 0 additions & 1 deletion src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <tinyformat.h>

#include <string>

/**
* Name of client reported in the 'version' message. Report the same name
Expand Down
3 changes: 0 additions & 3 deletions src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
#include <coins.h>

#include <consensus/consensus.h>
#include <memusage.h>
#include <random.h>

#include <assert.h>

bool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const { return false; }
uint256 CCoinsView::GetBestBlock() const { return uint256(); }
std::vector<uint256> CCoinsView::GetHeadBlocks() const { return std::vector<uint256>(); }
Expand Down
2 changes: 0 additions & 2 deletions src/dbwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

#include <dbwrapper.h>

#include <fs.h>
#include <util.h>
#include <random.h>

#include <leveldb/cache.h>
Expand Down
1 change: 0 additions & 1 deletion src/key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <arith_uint256.h>
#include <crypto/common.h>
#include <crypto/hmac_sha512.h>
#include <pubkey.h>
#include <random.h>

#include <secp256k1.h>
Expand Down
2 changes: 0 additions & 2 deletions src/keystore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#include <keystore.h>

#include <key.h>
#include <pubkey.h>
#include <util.h>

bool CKeyStore::AddKey(const CKey &key) {
Expand Down
1 change: 0 additions & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <primitives/transaction.h>
#include <script/standard.h>
#include <timedata.h>
#include <txmempool.h>
#include <util.h>
#include <utilmoneystr.h>
#include <masternode/masternode-payments.h>
Expand Down
2 changes: 0 additions & 2 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
#include <net.h>
#include <netmessagemaker.h>

#include <addrman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <consensus/consensus.h>
#include <crypto/common.h>
#include <crypto/sha256.h>
#include <hash.h>
#include <primitives/transaction.h>
#include <netbase.h>
#include <scheduler.h>
Expand Down
2 changes: 0 additions & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <init.h>
#include <validation.h>
#include <merkleblock.h>
#include <net.h>
#include <netmessagemaker.h>
#include <netbase.h>
#include <policy/fees.h>
Expand All @@ -31,7 +30,6 @@
#include <util.h>
#include <utilmoneystr.h>
#include <utilstrencodings.h>
#include <validationinterface.h>

#include <spork.h>
#include <governance/governance.h>
Expand Down
4 changes: 0 additions & 4 deletions src/netaddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifdef HAVE_CONFIG_H
#include <config/dash-config.h>
#endif

#include <netaddress.h>
#include <netbase.h>
#include <hash.h>
Expand Down
4 changes: 0 additions & 4 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifdef HAVE_CONFIG_H
#include <config/dash-config.h>
#endif

#include <netbase.h>

#include <hash.h>
Expand Down
1 change: 0 additions & 1 deletion src/policy/fees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <policy/fees.h>
#include <policy/policy.h>

#include <amount.h>
#include <clientversion.h>
#include <primitives/transaction.h>
#include <streams.h>
Expand Down
4 changes: 0 additions & 4 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#if defined(HAVE_CONFIG_H)
#include <config/dash-config.h>
#endif

#include <qt/bitcoingui.h>

#include <qt/bitcoinunits.h>
Expand Down
2 changes: 0 additions & 2 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
#include <QFlags>
#include <QIcon>
#include <QSettings>
#include <QString>
#include <QTreeWidget>
#include <QTreeWidgetItem>

QList<CAmount> CoinControlDialog::payAmounts;
CCoinControl* CoinControlDialog::coinControl = new CCoinControl();
Expand Down
1 change: 0 additions & 1 deletion src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <qt/qvalidatedlineedit.h>
#include <qt/walletmodel.h>

#include <fs.h>
#include <primitives/transaction.h>
#include <init.h>
#include <policy/policy.h>
Expand Down
1 change: 0 additions & 1 deletion src/qt/notificator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <QApplication>
#include <QByteArray>
#include <QIcon>
#include <QImageWriter>
#include <QMessageBox>
#include <QMetaType>
Expand Down
1 change: 0 additions & 1 deletion src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <qt/bitcoinunits.h>
#include <qt/guiutil.h>

#include <amount.h>
#include <init.h>
#include <validation.h> // For DEFAULT_SCRIPTCHECK_THREADS
#include <net.h>
Expand Down
2 changes: 0 additions & 2 deletions src/qt/platformstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

#include <QApplication>
#include <QColor>
#include <QIcon>
#include <QImage>
#include <QPalette>
#include <QPixmap>

static const struct {
const char *platformId;
Expand Down
2 changes: 0 additions & 2 deletions src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <qt/addressbookpage.h>
#include <qt/addresstablemodel.h>
#include <qt/bitcoinunits.h>
#include <qt/guiutil.h>
#include <qt/optionsmodel.h>
#include <qt/platformstyle.h>
#include <qt/receiverequestdialog.h>
Expand All @@ -17,7 +16,6 @@

#include <QAction>
#include <QCursor>
#include <QItemSelection>
#include <QMessageBox>
#include <QScrollBar>
#include <QTextDocument>
Expand Down
1 change: 0 additions & 1 deletion src/qt/receiverequestdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <qt/guiconstants.h>
#include <qt/guiutil.h>
#include <qt/optionsmodel.h>
#include <qt/walletmodel.h>

#include <QClipboard>
#include <QDrag>
Expand Down
2 changes: 0 additions & 2 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include <qt/bantablemodel.h>
#include <qt/clientmodel.h>
#include <qt/guiutil.h>
#include <qt/platformstyle.h>
#include <chainparams.h>
#include <netbase.h>
Expand All @@ -37,7 +36,6 @@
#include <QScrollBar>
#include <QSettings>
#include <QSignalMapper>
#include <QThread>
#include <QTime>
#include <QTimer>
#include <QStringList>
Expand Down
3 changes: 0 additions & 3 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <qt/optionsmodel.h>
#include <qt/platformstyle.h>
#include <qt/sendcoinsentry.h>
#include <qt/walletmodel.h>

#include <base58.h>
#include <wallet/coincontrol.h>
Expand All @@ -28,11 +27,9 @@
#include <privatesend/privatesend-client.h>

#include <QFontMetrics>
#include <QMessageBox>
#include <QScrollBar>
#include <QSettings>
#include <QTextDocument>
#include <QTimer>

#define SEND_CONFIRM_DELAY 3

Expand Down
1 change: 0 additions & 1 deletion src/qt/sendcoinsentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <qt/guiutil.h>
#include <qt/optionsmodel.h>
#include <qt/platformstyle.h>
#include <qt/walletmodel.h>

#include <QApplication>
#include <QClipboard>
Expand Down
2 changes: 0 additions & 2 deletions src/qt/transactionfilterproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#include <cstdlib>

#include <QDateTime>

// Earliest date that can be represented (far in the past)
const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);
// Last date that can be represented (far in the future)
Expand Down
1 change: 0 additions & 1 deletion src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <qt/bitcoinunits.h>
#include <qt/csvmodelwriter.h>
#include <qt/editaddressdialog.h>
#include <qt/guiutil.h>
#include <qt/optionsmodel.h>
#include <qt/platformstyle.h>
#include <qt/qrdialog.h>
Expand Down
2 changes: 0 additions & 2 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#include <set>
#include <stdint.h>

#include <univalue.h>

class CRPCConvertParam
{
public:
Expand Down
2 changes: 0 additions & 2 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
#include <memory>
#include <stdint.h>

#include <univalue.h>

unsigned int ParseConfirmTarget(const UniValue& value)
{
int target = value.get_int();
Expand Down
1 change: 0 additions & 1 deletion src/rpc/protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <utiltime.h>
#include <version.h>

#include <stdint.h>
#include <fstream>

/**
Expand Down
2 changes: 0 additions & 2 deletions src/rpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <util.h>
#include <utilstrencodings.h>

#include <univalue.h>

#include <boost/bind.hpp>
#include <boost/signals2/signal.hpp>
#include <boost/algorithm/string/case_conv.hpp> // for to_upper()
Expand Down
1 change: 0 additions & 1 deletion src/script/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <script/interpreter.h>

#include <primitives/transaction.h>
#include <crypto/ripemd160.h>
#include <crypto/sha1.h>
#include <crypto/sha256.h>
Expand Down
1 change: 0 additions & 1 deletion src/script/ismine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <key.h>
#include <keystore.h>
#include <script/script.h>
#include <script/standard.h>
#include <script/sign.h>


Expand Down
6 changes: 0 additions & 6 deletions src/test/test_dash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@
#include <consensus/consensus.h>
#include <consensus/validation.h>
#include <crypto/sha256.h>
#include <fs.h>
#include <key.h>
#include <validation.h>
#include <miner.h>
#include <net_processing.h>
#include <pubkey.h>
#include <random.h>
#include <txdb.h>
#include <txmempool.h>
#include <ui_interface.h>
#include <rpc/server.h>
#include <rpc/register.h>
Expand Down
6 changes: 0 additions & 6 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#if defined(HAVE_CONFIG_H)
#include <config/dash-config.h>
#endif

#include <util.h>

#include <support/allocators/secure.h>
#include <chainparamsbase.h>
#include <ctpl.h>
#include <fs.h>
#include <random.h>
#include <serialize.h>
#include <stacktraces.h>
#include <utilstrencodings.h>
#include <utiltime.h>

#include <stdarg.h>

Expand Down
3 changes: 0 additions & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <consensus/tx_verify.h>
#include <consensus/validation.h>
#include <cuckoocache.h>
#include <fs.h>
#include <hash.h>
#include <init.h>
#include <policy/fees.h>
Expand All @@ -40,7 +39,6 @@
#include <utilmoneystr.h>
#include <utilstrencodings.h>
#include <validationinterface.h>
#include <versionbits.h>
#include <warnings.h>

#include <masternode/masternode-payments.h>
Expand All @@ -53,7 +51,6 @@
#include <llmq/quorums_instantsend.h>
#include <llmq/quorums_chainlocks.h>

#include <atomic>
#include <future>
#include <sstream>

Expand Down
1 change: 0 additions & 1 deletion src/wallet/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <wallet/db.h>

#include <addrman.h>
#include <fs.h>
#include <hash.h>
#include <protocol.h>
#include <util.h>
Expand Down
1 change: 0 additions & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <timedata.h>
#include <txmempool.h>
#include <util.h>
#include <ui_interface.h>
#include <utilmoneystr.h>
#include <wallet/fees.h>

Expand Down

0 comments on commit fe8c18c

Please sign in to comment.