Merge pull request #9160

c50ade5 Daemon-specific proxy for the wallet-rpc. (0xFFFC0000)
This commit is contained in:
luigi1111 2024-02-24 10:11:51 -05:00
commit 72d87cd10a
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
5 changed files with 31 additions and 4 deletions

View file

@ -4412,6 +4412,13 @@ namespace tools
er.message = "Command unavailable in restricted mode.";
return false;
}
if (m_wallet->has_proxy_option() && !req.proxy.empty())
{
er.code = WALLET_RPC_ERROR_CODE_PROXY_ALREADY_DEFINED;
er.message = "It is not possible to set daemon specific proxy when --proxy is defined.";
return false;
}
std::vector<std::vector<uint8_t>> ssl_allowed_fingerprints;
ssl_allowed_fingerprints.reserve(req.ssl_allowed_fingerprints.size());
@ -4455,7 +4462,7 @@ namespace tools
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)))
if (!m_wallet->set_daemon(req.address, daemon_login, req.trusted, std::move(ssl_options), req.proxy))
{
er.code = WALLET_RPC_ERROR_CODE_NO_DAEMON_CONNECTION;
er.message = std::string("Unable to set daemon");