aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-02-16 17:58:41 -0500
committerCarl Dong <contact@carldong.me>2022-05-23 14:53:35 -0400
commitf329a9298c06ffe74b9e9fbc07bfe6d282fef9cb (patch)
tree441ef3ea0f23e9da9b8092826c7d09a18edc6850 /src/node
parent0e54456f0498e52131f8ae0c76b4dfe25f45b076 (diff)
downloadbitcoin-f329a9298c06ffe74b9e9fbc07bfe6d282fef9cb.tar.xz
scripted-diff: Move src/kernel/coinstats to kernel::
Introduces a new kernel:: namespace and move all of src/kernel/coinstats under it. In the verify script, lines like: line="$(grep -n 'namespace node {' -- src/kernel/coinstats.h | tail -n1 | cut -d: -f1)" sed -i -e "${line}s@namespace node {@namespace kernel {@" -- src/kernel/coinstats.h Are intended to replace only the last instance of "namespace node" with "namespace kernel", this is to avoid replacing forward declarations of things inside the node:: namespace. -BEGIN VERIFY SCRIPT- sed -E -i 's@namespace node@namespace kernel@g' -- src/kernel/coinstats.cpp line="$(grep -n 'namespace node {' -- src/kernel/coinstats.h | tail -n1 | cut -d: -f1)" sed -i -e "${line}s@namespace node {@namespace kernel {@" -- src/kernel/coinstats.h line="$(grep -n '// namespace node' -- src/kernel/coinstats.h | tail -n1 | cut -d: -f1)" sed -i -e "${line}s@// namespace node@// namespace kernel@" -- src/kernel/coinstats.h things='(CCoinsStats|CoinStatsHashType|GetBogoSize|TxOutSer|ComputeUTXOStats)' git grep -lE 'node::'"$things" | xargs sed -E -i 's@node::'"$things"'@kernel::\1@g' sed -E -i 's@'"$things"'@kernel::\1@g' -- src/node/coinstats.cpp src/node/coinstats.h sed -E -i 's@BlockManager@node::\0@g' -- src/kernel/coinstats.cpp -END VERIFY SCRIPT-
Diffstat (limited to 'src/node')
-rw-r--r--src/node/coinstats.cpp6
-rw-r--r--src/node/coinstats.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp
index 12c8e7b0da..784d33d698 100644
--- a/src/node/coinstats.cpp
+++ b/src/node/coinstats.cpp
@@ -11,10 +11,10 @@
#include <validation.h>
namespace node {
-std::optional<CCoinsStats> GetUTXOStats(CCoinsView* view, BlockManager& blockman, CoinStatsHashType hash_type, const std::function<void()>& interruption_point, const CBlockIndex* pindex, bool index_requested)
+std::optional<kernel::CCoinsStats> GetUTXOStats(CCoinsView* view, BlockManager& blockman, kernel::CoinStatsHashType hash_type, const std::function<void()>& interruption_point, const CBlockIndex* pindex, bool index_requested)
{
// Use CoinStatsIndex if it is requested and available and a hash_type of Muhash or None was requested
- if ((hash_type == CoinStatsHashType::MUHASH || hash_type == CoinStatsHashType::NONE) && g_coin_stats_index && index_requested) {
+ if ((hash_type == kernel::CoinStatsHashType::MUHASH || hash_type == kernel::CoinStatsHashType::NONE) && g_coin_stats_index && index_requested) {
if (pindex) {
return g_coin_stats_index->LookUpStats(pindex);
} else {
@@ -29,6 +29,6 @@ std::optional<CCoinsStats> GetUTXOStats(CCoinsView* view, BlockManager& blockman
// best block.
assert(!pindex || pindex->GetBlockHash() == view->GetBestBlock());
- return ComputeUTXOStats(hash_type, view, blockman, interruption_point);
+ return kernel::ComputeUTXOStats(hash_type, view, blockman, interruption_point);
}
} // namespace node
diff --git a/src/node/coinstats.h b/src/node/coinstats.h
index fbd5fd4067..b1d1384bb3 100644
--- a/src/node/coinstats.h
+++ b/src/node/coinstats.h
@@ -28,8 +28,8 @@ namespace node {
*
* @param[in] index_requested Signals if the coinstatsindex should be used (when available).
*/
-std::optional<CCoinsStats> GetUTXOStats(CCoinsView* view, node::BlockManager& blockman,
- CoinStatsHashType hash_type,
+std::optional<kernel::CCoinsStats> GetUTXOStats(CCoinsView* view, node::BlockManager& blockman,
+ kernel::CoinStatsHashType hash_type,
const std::function<void()>& interruption_point = {},
const CBlockIndex* pindex = nullptr,
bool index_requested = true);