mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-11-29 17:14:49 +01:00
bb357fcd2fnode: move block filter index ownership to NodeContext (woltx)66892cdd56net_processing: get block filter index via PeerManager::Options (woltx)e5b76bbdbbrpc: get index info from NodeContext indexes (woltx)fafedc683anode: move coinstatsindex ownership to NodeContext (woltx)2d1dc8f18anode: move txospenderindex ownership to NodeContext (woltx)530cf35c17node: move txindex ownership to NodeContext (woltx) Pull request description: This removes the remaining process-global index ownership and stores node-owned indexes in `NodeContext` instead. Indexes moved: - `g_txindex` - `g_txospenderindex` - `g_coin_stats_index` - `g_filter_indexes` `NodeContext` now owns these index instances, while `node.indexes` remains a non-owning list used for common index startup, shutdown, and `getindexinfo` handling. Behavior should be unchanged, apart from the key order in `getindexinfo` output. Indexes are still created from the same startup options, started in the same init step, stopped before destruction, and destroyed while `validation_signals` is still alive so they can unregister safely. The block filter index registry is moved to `node/indexes.{h,cpp}` so `index/` code does not depend on `NodeContext`. `PeerManager` receives a small lookup callback instead of reaching into global state. Review notes: - The first four commits are small and mostly mechanical: move `txindex`, `txospenderindex`, and `coinstatsindex` ownership to `NodeContext`, then make `getindexinfo` use `node.indexes`. The first commit also adds custom deleters in `node/indexes.cpp`, so `node/context.cpp` does not include index headers, which would create circular dependencies. - The fifth commit adds a block filter index lookup callback to `PeerManager::Options`, still backed by the global registry. - The last commit is the main one to review carefully. It moves block filter index ownership to `NodeContext`, moves the block filter registry to `node/indexes.{h,cpp}`, and points the `PeerManager` lookup at `NodeContext` instead of global state. ACKs for top commit: fjahr: ACKbb357fcd2fmaflcko: review ACKbb357fcd2f💬 andrewtoth: ACKbb357fcd2fTree-SHA512: 00bf7743241e844bc60c9e9d4d5e1f467d8c99a9f38583f701bdd6b36d57efa929e40697f5575488c78b8421edf689e93981f6d3d92766c24b956c8dc35f1a20