Currently the unloadwallet
RPC is asynchronous, it only signals the intent to unload the wallet and then returns the response to the client. The actual unload can happen later and the client has no way to be notified of that.
This PR makes the unloadwallet
RPC synchronous, meaning that it blocks until the wallet is fully unloaded.