diff options
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 7b791ae416..1f20834843 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -33,6 +33,13 @@ #include <utility> #include <vector> +//! Explicitly unload and delete the wallet. +// Blocks the current thread after signaling the unload intent so that all +// wallet clients release the wallet. +// Note that, when blocking is not required, the wallet is implicitly unloaded +// by the shared pointer deleter. +void UnloadWallet(std::shared_ptr<CWallet>&& wallet); + bool AddWallet(const std::shared_ptr<CWallet>& wallet); bool RemoveWallet(const std::shared_ptr<CWallet>& wallet); bool HasWallets(); @@ -817,6 +824,8 @@ public: ~CWallet() { + // Should not have slots connected at this point. + assert(NotifyUnload.empty()); delete encrypted_batch; encrypted_batch = nullptr; } |