Skip to content

Commit

Permalink
[wallet] Add StartWallets() function to wallet/init.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
John Newbery committed Sep 7, 2017
1 parent 290f3c5 commit 43b0e81
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "validationinterface.h"
#ifdef ENABLE_WALLET
#include "wallet/init.h"
#include "wallet/wallet.h"
#endif
#include "warnings.h"
#include <stdint.h>
Expand Down Expand Up @@ -1691,9 +1690,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
uiInterface.InitMessage(_("Done loading"));

#ifdef ENABLE_WALLET
for (CWalletRef pwallet : vpwallets) {
pwallet->postInitProcess(scheduler);
}
StartWallets(scheduler);
#endif

return !fRequestShutdown;
Expand Down
6 changes: 6 additions & 0 deletions src/wallet/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@ bool OpenWallets()
return true;
}

void StartWallets(CScheduler& scheduler) {
for (CWalletRef pwallet : vpwallets) {
pwallet->postInitProcess(scheduler);
}
}

void FlushWallets() {
for (CWalletRef pwallet : vpwallets) {
pwallet->Flush(false);
Expand Down
4 changes: 4 additions & 0 deletions src/wallet/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <string>

class CRPCTable;
class CScheduler;

//! Return the wallets help message.
std::string GetWalletHelpString(bool showDebug);
Expand All @@ -27,6 +28,9 @@ bool VerifyWallets();
//! Load wallet databases.
bool OpenWallets();

//! Complete startup of wallets.
void StartWallets(CScheduler& scheduler);

//! Flush all wallets in preparation for shutdown.
void FlushWallets();

Expand Down

0 comments on commit 43b0e81

Please sign in to comment.