diff --git a/src/init.h b/src/init.h --- a/src/init.h +++ b/src/init.h @@ -17,7 +17,7 @@ class RPCServer; class WalletInitInterface; -extern std::unique_ptr g_wallet_init_interface; +extern WalletInitInterface *const g_wallet_init_interface; namespace boost { class thread_group; diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -90,8 +90,8 @@ void Close() override {} }; -std::unique_ptr - g_wallet_init_interface(new DummyWalletInit); +static DummyWalletInit g_dummy_wallet_init; +WalletInitInterface *const g_wallet_init_interface = &g_dummy_wallet_init; #endif #if ENABLE_ZMQ @@ -292,7 +292,6 @@ GetMainSignals().UnregisterBackgroundSignalScheduler(); GetMainSignals().UnregisterWithMempoolSignals(g_mempool); g_wallet_init_interface->Close(); - g_wallet_init_interface.reset(); globalVerifyHandle.reset(); ECC_Stop(); LogPrintf("%s: done\n", __func__); diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -4,6 +4,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "init.h" #include "config.h" #include "net.h" #include "util.h" @@ -47,7 +48,8 @@ void Close() override; }; -std::unique_ptr g_wallet_init_interface(new WalletInit); +static WalletInit g_wallet_init; +WalletInitInterface *const g_wallet_init_interface = &g_wallet_init; std::string WalletInit::GetHelpString(bool showDebug) { std::string strUsage = HelpMessageGroup(_("Wallet options:"));