MCPcopy Create free account
hub / github.com/ElementsProject/elements / disconnected_cb

Method disconnected_cb

src/torcontrol.cpp:562–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void TorController::disconnected_cb(TorControlConnection& _conn)
563{
564 // Stop advertising service when disconnected
565 if (service.IsValid())
566 RemoveLocal(service);
567 service = CService();
568 if (!reconnect)
569 return;
570
571 LogPrint(BCLog::TOR, "tor: Not connected to Tor control port %s, trying to reconnect\n", m_tor_control_center);
572
573 // Single-shot timer for reconnect. Use exponential backoff.
574 struct timeval time = MillisToTimeval(int64_t(reconnect_timeout * 1000.0));
575 if (reconnect_ev)
576 event_add(reconnect_ev, &time);
577 reconnect_timeout *= RECONNECT_TIMEOUT_EXP;
578}
579
580void TorController::Reconnect()
581{

Callers

nothing calls this directly

Calls 4

RemoveLocalFunction · 0.85
MillisToTimevalFunction · 0.85
CServiceClass · 0.70
IsValidMethod · 0.45

Tested by

no test coverage detected