mirror of
https://github.com/monero-project/monero.git
synced 2025-08-08 13:52:20 -04:00
Daemon-specific proxy for the wallet-rpc.
1. Daemon-specific proxy is exclusive with global proxy (--proxy). 2. If you set global proxy (--proxy) you cannot set daemon-specific proxy. 3. If you don't set global proxy, you can set proxy (or not set) proxy for each daemon connection with the proxy field in jsonrpc to the wallet-rpc.
This commit is contained in:
parent
059028a30a
commit
c50ade514f
5 changed files with 31 additions and 4 deletions
|
@ -4406,6 +4406,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());
|
||||
|
@ -4449,7 +4456,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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue