Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/load.cpp
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | bool LoadWallets(const CChainParams &chainParams, interfaces::Chain &chain, | ||||
return true; | return true; | ||||
} | } | ||||
void StartWallets(CScheduler &scheduler) { | void StartWallets(CScheduler &scheduler) { | ||||
for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | ||||
pwallet->postInitProcess(); | pwallet->postInitProcess(); | ||||
} | } | ||||
// Run a thread to flush wallet periodically | // Schedule periodic wallet flushes and tx rebroadcasts | ||||
scheduler.scheduleEvery( | scheduler.scheduleEvery( | ||||
[] { | [] { | ||||
MaybeCompactWalletDB(); | MaybeCompactWalletDB(); | ||||
return true; | return true; | ||||
}, | }, | ||||
500); | 500); | ||||
scheduler.scheduleEvery( | |||||
[] { | |||||
MaybeResendWalletTxs(); | |||||
return true; | |||||
}, | |||||
1000); | |||||
} | } | ||||
void FlushWallets() { | void FlushWallets() { | ||||
for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | ||||
pwallet->Flush(false); | pwallet->Flush(false); | ||||
} | } | ||||
} | } | ||||
Show All 15 Lines |