From 33d73f69648ad7c0125cba6ae141a493c0333e02 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 14 Mar 2023 16:33:30 -0400 Subject: [PATCH] support tor proxy uri --- src/wallet/monero_wallet.h | 7 +++++++ src/wallet/monero_wallet_full.cpp | 4 ++++ src/wallet/monero_wallet_full.h | 1 + 3 files changed, 12 insertions(+) diff --git a/src/wallet/monero_wallet.h b/src/wallet/monero_wallet.h index 6f695c5..5fcda7a 100644 --- a/src/wallet/monero_wallet.h +++ b/src/wallet/monero_wallet.h @@ -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. * diff --git a/src/wallet/monero_wallet_full.cpp b/src/wallet/monero_wallet_full.cpp index 5b4bdfb..e6c394f 100644 --- a/src/wallet/monero_wallet_full.cpp +++ b/src/wallet/monero_wallet_full.cpp @@ -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& 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()); diff --git a/src/wallet/monero_wallet_full.h b/src/wallet/monero_wallet_full.h index 22d2039..3257fdd 100644 --- a/src/wallet/monero_wallet_full.h +++ b/src/wallet/monero_wallet_full.h @@ -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& connection) override; + void set_daemon_proxy(const std::string& uri = "") override; boost::optional get_daemon_connection() const override; bool is_connected_to_daemon() const override; bool is_daemon_synced() const override;