| 689 | } |
| 690 | |
| 691 | void TorController::disconnected_cb(TorControlConnection& _conn) |
| 692 | { |
| 693 | // Stop advertising service when disconnected |
| 694 | if (service.IsValid()) |
| 695 | RemoveLocal(service); |
| 696 | service = CService(); |
| 697 | if (!reconnect) |
| 698 | return; |
| 699 | |
| 700 | LogPrint(BCLog::TOR, "tor: Not connected to Tor control port %s, trying to reconnect\n", target); |
| 701 | |
| 702 | // Single-shot timer for reconnect. Use exponential backoff. |
| 703 | struct timeval time = MillisToTimeval(int64_t(reconnect_timeout * 1000.0)); |
| 704 | if (reconnect_ev) |
| 705 | event_add(reconnect_ev, &time); |
| 706 | reconnect_timeout *= RECONNECT_TIMEOUT_EXP; |
| 707 | } |
| 708 | |
| 709 | void TorController::Reconnect() |
| 710 | { |
nothing calls this directly
no test coverage detected