aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorwoodser <woodser@protonmail.com>2022-01-17 17:03:56 -0500
committerwoodser <woodser@protonmail.com>2022-01-31 08:08:30 -0500
commit41b87b1cc15291ad399d75005fa11855a9769a43 (patch)
tree1a3128941aef08495095af97f0548316ccc217e9 /src/wallet/wallet_rpc_server.cpp
parentMerge pull request #8131 (diff)
downloadmonero-41b87b1cc15291ad399d75005fa11855a9769a43.tar.xz
support authentication in monero-wallet-rpc set_daemon
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r--src/wallet/wallet_rpc_server.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index f324f8c72..d9aa3da02 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -4367,7 +4367,11 @@ namespace tools
return false;
}
- if (!m_wallet->set_daemon(req.address, boost::none, req.trusted, std::move(ssl_options)))
+ boost::optional<epee::net_utils::http::login> daemon_login{};
+ if (!req.username.empty() || !req.password.empty())
+ daemon_login.emplace(req.username, req.password);
+
+ if (!m_wallet->set_daemon(req.address, daemon_login, req.trusted, std::move(ssl_options)))
{
er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION;
er.message = std::string("Unable to set daemon");