diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-12-12 23:21:19 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2019-01-16 00:33:32 +0000 |
commit | 0cd9ad208c327127cc4616ccdc37557fad3cf381 (patch) | |
tree | 41393ae40812ce24475b650c89b70858d88f0336 /src/wallet/rpcwallet.cpp | |
parent | 0a0b2ea11fde7becbdd1c04205336c3a39bffbc0 (diff) | |
download | bitcoin-0cd9ad208c327127cc4616ccdc37557fad3cf381.tar.xz |
rpc: Make unloadwallet wait for complete wallet unload
Github-Pull: #14941
Rebased-From: c37851d
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r-- | src/wallet/rpcwallet.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e02171ec40..cc429f5e56 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; } |