aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2019-01-31 15:35:26 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2019-01-31 15:35:30 +0100
commit30db5cc6418aa104c05b21ceceea3f04d1066b5f (patch)
treecc1e5be832e20b396b0f15500f134cf531f186df /src/wallet/rpcwallet.cpp
parent09a9238c045670ce22a2798a717925248d1483f4 (diff)
parent0cd9ad208c327127cc4616ccdc37557fad3cf381 (diff)
downloadbitcoin-30db5cc6418aa104c05b21ceceea3f04d1066b5f.tar.xz
Merge #15002: 0.17: Backport #14941
0cd9ad208c327127cc4616ccdc37557fad3cf381 rpc: Make unloadwallet wait for complete wallet unload (João Barbosa) Pull request description: #14941 makes `unloadwallet` a synchronous call meaning that it waits for the wallet to fully unload/delete. Tree-SHA512: df7a490306ee2cca399129a4ebfba4b19b65fe67d1657ec3518352fe453327cb347010f94cf7fe4a60aeb51c928cb9ad6b24c40123fd0b9dc0aab5920a59f48d
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 64cc8278ff..762f5c3012 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -3239,16 +3239,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;
}