Merge pull request #8145

fb5b2b3 support authentication in monero-wallet-rpc set_daemon (woodser)
This commit is contained in:
luigi1111 2022-03-02 18:53:34 -05:00
commit 27f1d43547
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
2 changed files with 9 additions and 1 deletions

View file

@ -4380,7 +4380,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");