[wallet] Use global g_wallet_init_interface to init/destroy the wallet.

This commit creates a global g_wallet_init_interface, which is created
in bitcoind and bitcoin-qt. g_wallet_init_interface is used to init
and destroy the wallet.

This removes the dependency from init.cpp on the wallet library.
This commit is contained in:
John Newbery
2018-02-21 11:38:53 -05:00
parent caaf9722f3
commit 49baa4a462
5 changed files with 53 additions and 42 deletions

View File

@@ -18,6 +18,10 @@
#include <httpserver.h>
#include <httprpc.h>
#include <utilstrencodings.h>
#if ENABLE_WALLET
#include <wallet/init.h>
#include <walletinitinterface.h>
#endif
#include <boost/thread.hpp>
@@ -59,6 +63,10 @@ bool AppInit(int argc, char* argv[])
{
bool fRet = false;
#if ENABLE_WALLET
g_wallet_init_interface.reset(new WalletInit);
#endif
//
// Parameters
//