[bitcoin/bitcoin] [wallet] `loadwallet` RPC – load wallet at runtime (#10740)

promag commented on this pull request.

> + ” “name” : , (string) The wallet name if loaded successfully.n”
+ “}n”
+ “nExamples:n”
+ + HelpExampleCli(“loadwallet”, “”test.dat””)
+ + HelpExampleRpc(“loadwallet”, “”test.dat””)
+ );
+ std::string wallet_file = request.params[0].get_str();
+ std::string error;
+
+ fs::path wallet_path = fs::absolute(wallet_file, GetWalletDir());
+ if (fs::symlink_status(wallet_path).type() == fs::file_not_found) {
+ throw JSONRPCError(RPC_WALLET_NOT_FOUND, “Wallet ” + wallet_file + ” not found.”);
+ }
+
+ std::string dummy_warning;
+ if (!CWallet::Verify(wallet_file, false, error, dummy_warning)) {

Hmm @jnewbery this is missing https://github.com/bitcoin/bitcoin/pull/10740#discussion_r183742636.

This post was last modified on May 7, 2018, 6:12 pm