Pass chain and client variables where needed

This commit does not change behavior. All it does is pass new function
parameters.

It is easiest to review this change with:

    git log -p -n1 -U0 --word-diff-regex=.
This commit is contained in:
Russell Yanofsky
2017-05-30 15:55:17 -04:00
parent 7e2e62cf7c
commit 8db11dd0b1
24 changed files with 138 additions and 63 deletions

View File

@@ -10,8 +10,17 @@
#include <string>
#include <util/system.h>
class CScheduler;
class CWallet;
namespace interfaces {
class Chain;
class ChainClient;
} // namespace interfaces
//! Pointers to interfaces used during init and destroyed on shutdown.
struct InitInterfaces
{
std::unique_ptr<interfaces::Chain> chain;
std::vector<std::unique_ptr<interfaces::ChainClient>> chain_clients;
};
namespace boost
{
@@ -20,7 +29,7 @@ class thread_group;
/** Interrupt threads */
void Interrupt();
void Shutdown();
void Shutdown(InitInterfaces& interfaces);
//!Initialize the logging infrastructure
void InitLogging();
//!Parameter interaction: change current parameters depending on various rules
@@ -54,7 +63,7 @@ bool AppInitLockDataDirectory();
* @note This should only be done after daemonization. Call Shutdown() if this function fails.
* @pre Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.
*/
bool AppInitMain();
bool AppInitMain(InitInterfaces& interfaces);
/**
* Setup the arguments for gArgs