refactor: init indexes, decouple 'Start()' from the creation step

No behavior change.

The goal here is to group indexes, so we can perform the same
initialization and verification process equally for all of them.

The checks performed inside `StartIndexes` will be expanded
in the subsequent commits.
This commit is contained in:
furszy
2023-06-16 10:16:22 -03:00
parent 2ebc7e68cc
commit 225e213110
3 changed files with 18 additions and 10 deletions

View File

@@ -15,8 +15,9 @@
#include <vector>
class ArgsManager;
class BanMan;
class AddrMan;
class BanMan;
class BaseIndex;
class CBlockPolicyEstimator;
class CConnman;
class CScheduler;
@@ -58,6 +59,7 @@ struct NodeContext {
std::unique_ptr<ChainstateManager> chainman;
std::unique_ptr<BanMan> banman;
ArgsManager* args{nullptr}; // Currently a raw pointer because the memory is not managed by this struct
std::vector<BaseIndex*> indexes; // raw pointers because memory is not managed by this struct
std::unique_ptr<interfaces::Chain> chain;
//! List of all chain clients (wallet processes or other client) connected to node.
std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;