aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/coinstats.cpp
AgeCommit message (Collapse)Author
2022-07-20Use HashWriter where possibleMacroFake
2022-07-19ci: Enable IWYU in src/kernel directoryRyan Ofsky
Suggested https://github.com/bitcoin/bitcoin/pull/25308#discussion_r892505713
2022-05-23scripted-diff: Move src/kernel/coinstats to kernel::Carl Dong
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-
2022-05-23coinstats: Split node/coinstats.h to kernel/coinstats.hCarl Dong
Most of this commit is pure-move. After this change: - kernel/coinstats.h -> Contains declarations for: - enum class CoinStatsHashType - struct CCoinsStats - GetBogoSize(...) - TxOutSer(...) - ComputeUTXOStats(...) - node/coinstats.h -> Just GetUTXOStats, which will be removed as we change callers to directly use the hashing/indexing codepaths in future commits.
2022-05-23coinstats: Move hasher codepath to kernel/coinstatsCarl Dong
As mentioned in a previous commit, the hashing codepath can now be moved to a separate file. This decouples callers that only rely on the hashing codepath from the indexing one. This is key for libbitcoinkernel, which needs to have the CoinsStats hashing codepath for AssumeUTXO, but does not wish to be coupled with indexes. Note that only the .cpp file is split in this commit, the header files will be split in a subsequent commit and the #includes to node/coinstats.h will be adjusted to only #include the necessary headers.