leaderForTerm

abstract suspend fun leaderForTerm(): LeaderForTerm?

Returns the leader this node established for some term, or null if it has never established one. See saveLeaderForTerm.

The returned LeaderForTerm.term is not necessarily the current term — the engine compares it to currentTerm at every read and treats a mismatch as "no leader established for this term". An implementation must return the record it was last given, unchanged; deciding whether it is still relevant is not the storage's job.