diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2016-09-09 08:42:30 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2017-06-06 21:17:09 +0000 |
commit | b124cf04ea47e1eda60bbc26a9690a9715c6b23f (patch) | |
tree | a6efe783bcbcf8b37736d20de0aa365ae352e161 /src/init.cpp | |
parent | 19b3648bb52d27c3a9674159d71726b73fe532d9 (diff) |
Wallet: Replace pwalletMain with a vector of wallet pointers
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/init.cpp b/src/init.cpp index 33023a1800..cc630d7337 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -198,8 +198,9 @@ void Shutdown() StopRPC(); StopHTTPServer(); #ifdef ENABLE_WALLET - if (pwalletMain) - pwalletMain->Flush(false); + for (CWalletRef pwallet : vpwallets) { + pwallet->Flush(false); + } #endif MapPort(false); UnregisterValidationInterface(peerLogic.get()); @@ -239,8 +240,9 @@ void Shutdown() pblocktree = NULL; } #ifdef ENABLE_WALLET - if (pwalletMain) - pwalletMain->Flush(true); + for (CWalletRef pwallet : vpwallets) { + pwallet->Flush(true); + } #endif #if ENABLE_ZMQ @@ -260,8 +262,10 @@ void Shutdown() #endif UnregisterAllValidationInterfaces(); #ifdef ENABLE_WALLET - delete pwalletMain; - pwalletMain = NULL; + for (CWalletRef pwallet : vpwallets) { + delete pwallet; + } + vpwallets.clear(); #endif globalVerifyHandle.reset(); ECC_Stop(); @@ -1673,8 +1677,9 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) uiInterface.InitMessage(_("Done loading")); #ifdef ENABLE_WALLET - if (pwalletMain) - pwalletMain->postInitProcess(scheduler); + for (CWalletRef pwallet : vpwallets) { + pwallet->postInitProcess(scheduler); + } #endif return !fRequestShutdown; |