From 3b58c118ddc2566f0440954fc6bbdc02a2f92f4b Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 15 Sep 2021 12:43:09 -0700 Subject: [PATCH] ipn/ipnlocal: inline LocalBackend.getEngineStatus For uniformity. Signed-off-by: Josh Bleecher Snyder --- ipn/ipnlocal/local.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 923bc33fd..8bee8f815 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -1437,16 +1437,6 @@ func (b *LocalBackend) InServerMode() bool { return b.inServerMode } -// getEngineStatus returns a copy of b.engineStatus. -// -// TODO(bradfitz): remove this and use Status() throughout. -func (b *LocalBackend) getEngineStatus() ipn.EngineStatus { - b.mu.Lock() - defer b.mu.Unlock() - - return b.engineStatus -} - // Login implements Backend. func (b *LocalBackend) Login(token *tailcfg.Oauth2Token) { b.mu.Lock() @@ -2346,6 +2336,7 @@ func (b *LocalBackend) nextState() ipn.State { blocked = b.blocked wantRunning = b.prefs.WantRunning loggedOut = b.prefs.LoggedOut + st = b.engineStatus ) b.mu.Unlock() @@ -2387,7 +2378,7 @@ func (b *LocalBackend) nextState() ipn.State { // (if we get here, we know MachineAuthorized == true) return ipn.Starting case state == ipn.Starting: - if st := b.getEngineStatus(); st.NumLive > 0 || st.LiveDERPs > 0 { + if st.NumLive > 0 || st.LiveDERPs > 0 { return ipn.Running } else { return state