Start using init makeNode, makeChain, etc methods

Use interfaces::Init::make* methods instead of interfaces::Make*
functions, so interfaces can be constructed differently in different
executables without having to change any code. (So for example
bitcoin-gui can make an interfaces::Node pointer that communicates with
a bitcoin-node subprocess, while bitcoin-qt can make an interfaces::Node
pointer that starts node code in the same process.)
This commit is contained in:
Russell Yanofsky
2017-12-05 15:57:12 -05:00
parent fdd80b0a53
commit e4709c7b56
17 changed files with 63 additions and 22 deletions

View File

@@ -26,6 +26,7 @@
#include <index/txindex.h>
#include <init/common.h>
#include <interfaces/chain.h>
#include <interfaces/init.h>
#include <interfaces/node.h>
#include <mapport.h>
#include <miner.h>
@@ -1056,7 +1057,7 @@ bool AppInitLockDataDirectory()
bool AppInitInterfaces(NodeContext& node)
{
node.chain = interfaces::MakeChain(node);
node.chain = node.init->makeChain();
// Create client interfaces for wallets that are supposed to be loaded
// according to -wallet and -disablewallet options. This only constructs
// the interfaces, it doesn't load wallet data. Wallets actually get loaded