aboutsummaryrefslogtreecommitdiff
path: root/src/i2p.cpp
diff options
context:
space:
mode:
authorMatthew Zipkin <pinheadmz@gmail.com>2023-07-13 12:40:42 -0400
committerMatthew Zipkin <pinheadmz@gmail.com>2024-03-01 14:47:29 -0500
commita88bf9dedd1d8c1db0a9c8b663dab3e3c2f0f030 (patch)
treebae24279ee0549563fc48cce4f9ccf8383164aef /src/i2p.cpp
parentd9318a37ec09fe0b002815a7e48710e530620ae2 (diff)
downloadbitcoin-a88bf9dedd1d8c1db0a9c8b663dab3e3c2f0f030.tar.xz
i2p: construct Session with Proxy instead of CService
Diffstat (limited to 'src/i2p.cpp')
-rw-r--r--src/i2p.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/i2p.cpp b/src/i2p.cpp
index fc9e741f40..f3689a7e51 100644
--- a/src/i2p.cpp
+++ b/src/i2p.cpp
@@ -115,7 +115,7 @@ static CNetAddr DestB64ToAddr(const std::string& dest)
namespace sam {
Session::Session(const fs::path& private_key_file,
- const CService& control_host,
+ const Proxy& control_host,
CThreadInterrupt* interrupt)
: m_private_key_file{private_key_file},
m_control_host{control_host},
@@ -124,7 +124,7 @@ Session::Session(const fs::path& private_key_file,
{
}
-Session::Session(const CService& control_host, CThreadInterrupt* interrupt)
+Session::Session(const Proxy& control_host, CThreadInterrupt* interrupt)
: m_control_host{control_host},
m_interrupt{interrupt},
m_transient{true}
@@ -326,10 +326,10 @@ Session::Reply Session::SendRequestAndGetReply(const Sock& sock,
std::unique_ptr<Sock> Session::Hello() const
{
- auto sock = ConnectDirectly(m_control_host, true);
+ auto sock = m_control_host.Connect();
if (!sock) {
- throw std::runtime_error(strprintf("Cannot connect to %s", m_control_host.ToStringAddrPort()));
+ throw std::runtime_error(strprintf("Cannot connect to %s", m_control_host.ToString()));
}
SendRequestAndGetReply(*sock, "HELLO VERSION MIN=3.1 MAX=3.1");
@@ -413,7 +413,7 @@ void Session::CreateIfNotCreatedAlready()
const auto session_type = m_transient ? "transient" : "persistent";
const auto session_id = GetRandHash().GetHex().substr(0, 10); // full is overkill, too verbose in the logs
- Log("Creating %s SAM session %s with %s", session_type, session_id, m_control_host.ToStringAddrPort());
+ Log("Creating %s SAM session %s with %s", session_type, session_id, m_control_host.ToString());
auto sock = Hello();