Extend comment explaining TorState -> State mapping.

This commit is contained in:
akwizgran
2023-06-22 13:12:58 +01:00
parent 3cc5699fe0
commit a6b3749fb6

View File

@@ -630,7 +630,9 @@ class TorPlugin implements DuplexPlugin, EventListener {
private synchronized State getState(TorState torState) {
// Treat TorState.STARTED as State.STARTING_STOPPING because it's
// only seen during startup, before TorWrapper#enableNetwork() is
// called for the first time
// called for the first time. TorState.NOT_STARTED and
// TorState.STOPPED are mapped to State.STARTING_STOPPING because
// that's the State before we've started and after we've stopped.
if (torState == TorState.NOT_STARTED ||
torState == TorState.STARTING ||
torState == TorState.STARTED ||