aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <[email protected]>2016-10-20 09:22:13 +0200
committerJonas Schnelli <[email protected]>2016-10-20 09:22:13 +0200
commitcab1da745b2a36407bb9493343cc74213854419d (patch)
tree5f250b614ebfc21e8ede93c8eb80aed658945424 /src/wallet/wallet.cpp
parentMerge #8928: Fix init segfault where InitLoadWallet() calls ATMP before genesis (diff)
downloaddiscoin-cab1da745b2a36407bb9493343cc74213854419d.tar.xz
discoin-cab1da745b2a36407bb9493343cc74213854419d.zip
[Wallet] Refactor wallet/init interaction (Reaccept wtx, flush thread)
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index c7f98b238..66f92d887 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3472,6 +3472,16 @@ bool CWallet::InitLoadWallet()
return true;
}
+void CWallet::postInitProcess(boost::thread_group& threadGroup)
+{
+ // Add wallet transactions that aren't already in a block to mempool
+ // Do this here as mempool requires genesis block to be loaded
+ ReacceptWalletTransactions();
+
+ // Run a thread to flush wallet periodically
+ threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(this->strWalletFile)));
+}
+
bool CWallet::ParameterInteraction()
{
if (GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET))