Skip to content

Commit 90fc8b0

Browse files
committed
Add src/node/* code to node:: namespace
1 parent 4ada742 commit 90fc8b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+283
-61
lines changed

src/bench/coin_selection.cpp

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

1212
#include <set>
1313

14+
using node::NodeContext;
15+
1416
static void addCoin(const CAmount& nValue, const CWallet& wallet, std::vector<std::unique_ptr<CWalletTx>>& wtxs)
1517
{
1618
static int nextLockTime = 0;

src/bitcoind.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <functional>
3131
#include <optional>
3232

33+
using node::NodeContext;
34+
3335
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
3436
UrlDecodeFn* const URL_DECODE = urlDecode;
3537

src/dummywallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DummyWalletInit : public WalletInitInterface {
2121
bool HasWalletSupport() const override {return false;}
2222
void AddWalletOptions(ArgsManager& argsman) const override;
2323
bool ParameterInteraction() const override {return true;}
24-
void Construct(NodeContext& node) const override {LogPrintf("No wallet support compiled in!\n");}
24+
void Construct(node::NodeContext& node) const override {LogPrintf("No wallet support compiled in!\n");}
2525
};
2626

2727
void DummyWalletInit::AddWalletOptions(ArgsManager& argsman) const

src/index/base.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include <validation.h> // For g_chainman
1515
#include <warnings.h>
1616

17+
using node::ReadBlockFromDisk;
18+
1719
constexpr uint8_t DB_BEST_BLOCK{'B'};
1820

1921
constexpr int64_t SYNC_LOG_INTERVAL = 30; // seconds

src/index/blockfilterindex.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <node/blockstorage.h>
1010
#include <util/system.h>
1111

12+
using node::UndoReadFromDisk;
13+
1214
/* The index database stores three items for each block: the disk location of the encoded filter,
1315
* its dSHA256 hash, and the header. Those belonging to blocks on the active chain are indexed by
1416
* height, and those belonging to blocks that have been reorganized out of the active chain are

src/index/coinstatsindex.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
#include <undo.h>
1313
#include <validation.h>
1414

15+
using node::CCoinsStats;
16+
using node::GetBogoSize;
17+
using node::ReadBlockFromDisk;
18+
using node::TxOutSer;
19+
using node::UndoReadFromDisk;
20+
1521
static constexpr uint8_t DB_BLOCK_HASH{'s'};
1622
static constexpr uint8_t DB_BLOCK_HEIGHT{'t'};
1723
static constexpr uint8_t DB_MUHASH{'M'};

src/index/coinstatsindex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CoinStatsIndex final : public BaseIndex
5252
explicit CoinStatsIndex(size_t n_cache_size, bool f_memory = false, bool f_wipe = false);
5353

5454
// Look up stats for a specific block using CBlockIndex
55-
bool LookUpStats(const CBlockIndex* block_index, CCoinsStats& coins_stats) const;
55+
bool LookUpStats(const CBlockIndex* block_index, node::CCoinsStats& coins_stats) const;
5656
};
5757

5858
/// The global UTXO set hash object.

src/index/txindex.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <util/system.h>
1010
#include <validation.h>
1111

12+
using node::OpenBlockFile;
13+
1214
constexpr uint8_t DB_TXINDEX{'t'};
1315

1416
std::unique_ptr<TxIndex> g_txindex;

src/init.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@
9595
#include <zmq/zmqrpc.h>
9696
#endif
9797

98+
using node::CacheSizes;
99+
using node::CalculateCacheSizes;
100+
using node::ChainstateLoadVerifyError;
101+
using node::ChainstateLoadingError;
102+
using node::CleanupBlockRevFiles;
103+
using node::DEFAULT_PRINTPRIORITY;
104+
using node::DEFAULT_STOPAFTERBLOCKIMPORT;
105+
using node::LoadChainstate;
106+
using node::NodeContext;
107+
using node::ThreadImport;
108+
using node::VerifyLoadedChainstate;
109+
using node::fHavePruned;
110+
using node::fPruneMode;
111+
using node::fReindex;
112+
using node::nPruneTarget;
113+
98114
static const bool DEFAULT_PROXYRANDOMIZE = true;
99115
static const bool DEFAULT_REST_ENABLE = false;
100116

src/init.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ static constexpr bool DEFAULT_DAEMON = false;
1616
static constexpr bool DEFAULT_DAEMONWAIT = false;
1717

1818
class ArgsManager;
19-
struct NodeContext;
2019
namespace interfaces {
2120
struct BlockAndHeaderTipInfo;
2221
}
22+
namespace node {
23+
struct NodeContext;
24+
} // namespace node
2325

2426
/** Interrupt threads */
25-
void Interrupt(NodeContext& node);
26-
void Shutdown(NodeContext& node);
27+
void Interrupt(node::NodeContext& node);
28+
void Shutdown(node::NodeContext& node);
2729
//!Initialize the logging infrastructure
2830
void InitLogging(const ArgsManager& args);
2931
//!Parameter interaction: change current parameters depending on various rules
@@ -55,13 +57,13 @@ bool AppInitLockDataDirectory();
5557
/**
5658
* Initialize node and wallet interface pointers. Has no prerequisites or side effects besides allocating memory.
5759
*/
58-
bool AppInitInterfaces(NodeContext& node);
60+
bool AppInitInterfaces(node::NodeContext& node);
5961
/**
6062
* Bitcoin core main initialization.
6163
* @note This should only be done after daemonization. Call Shutdown() if this function fails.
6264
* @pre Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.
6365
*/
64-
bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info = nullptr);
66+
bool AppInitMain(node::NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info = nullptr);
6567

6668
/**
6769
* Register all arguments with the ArgsManager

0 commit comments

Comments
 (0)