8000 Using absolute path for dumpwallet rpc by levonpetrosyan93 · Pull Request #1047 · firoorg/firo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Using absolute path for dumpwallet rpc #1047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/wallet/rpcdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,12 @@ UniValue dumpwallet(const JSONRPCRequest& request)

EnsureWalletIsUnlocked(pwallet);

boost::filesystem::path filePath = request.params[0].get_str();
filePath = boost::filesystem::absolute(filePath);

std::ofstream file;
file.open(request.params[0].get_str().c_str());
file.open(filePath.string().c_str());

if (!file.is_open())
throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot open wallet dump file");

Expand Down Expand Up @@ -804,7 +808,10 @@ UniValue dumpwallet(const JSONRPCRequest& request)
file << "\n";
file << "# End of dump\n";
file.close();
return NullUniValue;

UniValue reply(UniValue::VOBJ);
reply.push_back(Pair("filename", filePath.string()));
return reply;
}

UniValue dumpwallet_firo(const JSONRPCRequest& request)
Expand Down
0