Page MenuHomePhabricator

coinstats: Split node/coinstats.h to kernel/coinstats.h
ClosedPublic

Authored by PiRK on May 2 2024, 12:36.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCb4054a5c21a9: coinstats: Split node/coinstats.h to kernel/coinstats.h
Summary

Most of this commit is pure-move. It also fixes a circular dependency and adjusts namespaces.

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.

This is a partial backport of core#24410
https://github.com/bitcoin/bitcoin/pull/24410/commits/80970985c965f79b8c376c8a922497e385445dd8
https://github.com/bitcoin/bitcoin/pull/24410/commits/0e54456f0498e52131f8ae0c76b4dfe25f45b076
https://github.com/bitcoin/bitcoin/pull/24410/commits/f329a9298c06ffe74b9e9fbc07bfe6d282fef9cb
https://github.com/bitcoin/bitcoin/pull/24410/commits/faa52387e8e4856445b1cfc9b5e072ce8f690f36
https://github.com/bitcoin/bitcoin/pull/24410/commits/f1006875665ffe8ff5da8185effe25b860743b4e (minor follow-up to D14673)

Test Plan
cmake .. -GNinja -DBUILD_BITCOIN_CHAINSTATE=ON
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.May 2 2024, 12:36

Note that phabricator and git get confused by the moving of code and interpret it as a kernel/coinstats.h->node/coinstats.h copy (and vice-versa). But the code is only moved from a node to a kernel header.

This revision is now accepted and ready to land.May 2 2024, 19:23