support tor proxy uri

This commit is contained in:
woodser
2023-04-02 16:08:29 -04:00
parent d36eae0629
commit 33d73f6964
3 changed files with 12 additions and 0 deletions
+7
View File
@@ -159,6 +159,13 @@ namespace monero {
throw std::runtime_error("set_daemon_connection() not supported");
}
/**
* Set the Tor proxy to the daemon.
*/
virtual void set_daemon_proxy(const std::string& uri = "") {
throw std::runtime_error("set_daemon_proxy() not supported");
}
/**
* Get the wallet's daemon connection.
*
+4
View File
@@ -1283,6 +1283,10 @@ namespace monero {
is_connected_to_daemon(); // update m_is_connected cache // TODO: better naming?
}
void monero_wallet_full::set_daemon_proxy(const std::string& uri) {
m_w2->set_proxy(uri);
}
void monero_wallet_full::set_daemon_connection(const boost::optional<monero_rpc_connection>& connection) {
if (connection == boost::none) set_daemon_connection("");
else set_daemon_connection(connection->m_uri == boost::none ? "" : connection->m_uri.get(), connection->m_username == boost::none ? "" : connection->m_username.get(), connection->m_password == boost::none ? "" : connection->m_password.get());
+1
View File
@@ -185,6 +185,7 @@ namespace monero {
bool is_view_only() const override { return m_w2->watch_only(); }
void set_daemon_connection(const std::string& uri, const std::string& username = "", const std::string& password = "") override;
void set_daemon_connection(const boost::optional<monero_rpc_connection>& connection) override;
void set_daemon_proxy(const std::string& uri = "") override;
boost::optional<monero_rpc_connection> get_daemon_connection() const override;
bool is_connected_to_daemon() const override;
bool is_daemon_synced() const override;