MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReleaseWallet

Function ReleaseWallet

src/wallet/wallet.cpp:195–210  ·  view source on GitHub ↗

Custom deleter for shared_ptr .

Source from the content-addressed store, hash-verified

193
194// Custom deleter for shared_ptr<CWallet>.
195static void ReleaseWallet(CWallet* wallet)
196{
197 const std::string name = wallet->GetName();
198 wallet->WalletLogPrintf("Releasing wallet\n");
199 wallet->Flush();
200 delete wallet;
201 // Wallet is now released, notify UnloadWallet, if any.
202 {
203 LOCK(g_wallet_release_mutex);
204 if (g_unloading_wallet_set.erase(name) == 0) {
205 // UnloadWallet was not called for this wallet, all done.
206 return;
207 }
208 }
209 g_wallet_release_cv.notify_all();
210}
211
212void UnloadWallet(std::shared_ptr<CWallet>&& wallet)
213{

Callers

nothing calls this directly

Calls 4

GetNameMethod · 0.45
WalletLogPrintfMethod · 0.45
FlushMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected