Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/load.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | scheduler.scheduleEvery( | ||||
MaybeResendWalletTxs(); | MaybeResendWalletTxs(); | ||||
return true; | return true; | ||||
}, | }, | ||||
std::chrono::milliseconds{1000}); | std::chrono::milliseconds{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(); | ||||
} | } | ||||
} | } | ||||
void StopWallets() { | void StopWallets() { | ||||
for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | for (const std::shared_ptr<CWallet> &pwallet : GetWallets()) { | ||||
pwallet->Flush(true); | pwallet->Close(); | ||||
} | } | ||||
} | } | ||||
void UnloadWallets() { | void UnloadWallets() { | ||||
auto wallets = GetWallets(); | auto wallets = GetWallets(); | ||||
while (!wallets.empty()) { | while (!wallets.empty()) { | ||||
auto wallet = wallets.back(); | auto wallet = wallets.back(); | ||||
wallets.pop_back(); | wallets.pop_back(); | ||||
RemoveWallet(wallet); | RemoveWallet(wallet); | ||||
UnloadWallet(std::move(wallet)); | UnloadWallet(std::move(wallet)); | ||||
} | } | ||||
} | } |