aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2018-12-12 23:21:19 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-01-15 00:01:00 +0000
commitc37851de5752f107c16e19317f28038b6b7ca2dc (patch)
tree9630a18acef413ea7fed27268037db1a84ead1f5 /src/wallet/rpcwallet.cpp
parente7b88ecbc920321290941bc68e4a71634889c3cb (diff)
downloadbitcoin-c37851de5752f107c16e19317f28038b6b7ca2dc.tar.xz
rpc: Make unloadwallet wait for complete wallet unload
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 1d9ab54857..87d6d9262c 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2625,16 +2625,8 @@ static UniValue unloadwallet(const JSONRPCRequest& request)
if (!RemoveWallet(wallet)) {
throw JSONRPCError(RPC_MISC_ERROR, "Requested wallet already unloaded");
}
- UnregisterValidationInterface(wallet.get());
- // The wallet can be in use so it's not possible to explicitly unload here.
- // Just notify the unload intent so that all shared pointers are released.
- // The wallet will be destroyed once the last shared pointer is released.
- wallet->NotifyUnload();
-
- // There's no point in waiting for the wallet to unload.
- // At this point this method should never fail. The unloading could only
- // fail due to an unexpected error which would cause a process termination.
+ UnloadWallet(std::move(wallet));
return NullUniValue;
}