| 350 | } |
| 351 | |
| 352 | TorController::TorController(const std::string& tor_control_center, const CService& target) |
| 353 | : m_tor_control_center(tor_control_center), |
| 354 | m_conn(m_interrupt), |
| 355 | m_reconnect(true), |
| 356 | m_reconnect_timeout(RECONNECT_TIMEOUT_START), |
| 357 | m_target(target) |
| 358 | { |
| 359 | // Read service private key if cached |
| 360 | std::pair<bool,std::string> pkf = ReadBinaryFile(GetPrivateKeyFile()); |
| 361 | if (pkf.first) { |
| 362 | LogDebug(BCLog::TOR, "Reading cached private key from %s", fs::PathToString(GetPrivateKeyFile())); |
| 363 | m_private_key = pkf.second; |
| 364 | } |
| 365 | m_thread = std::thread(&util::TraceThread, "torcontrol", [this] { ThreadControl(); }); |
| 366 | } |
| 367 | |
| 368 | TorController::~TorController() |
| 369 | { |
nothing calls this directly
no test coverage detected