@@ -101,7 +101,10 @@ func newSessionRPCServer(cfg *sessionRpcServerConfig) (*sessionRpcServer,
101101// requests. This includes resuming all non-revoked sessions.
102102func (s * sessionRpcServer ) start (ctx context.Context ) error {
103103 // Start up all previously created sessions.
104- sessions , err := s .cfg .db .ListSessions ()
104+ sessions , err := s .cfg .db .ListSessions (
105+ session .StateCreated ,
106+ session .StateInUse ,
107+ )
105108 if err != nil {
106109 return fmt .Errorf ("error listing sessions: %v" , err )
107110 }
@@ -126,12 +129,6 @@ func (s *sessionRpcServer) start(ctx context.Context) error {
126129 continue
127130 }
128131
129- if sess .State != session .StateInUse &&
130- sess .State != session .StateCreated {
131-
132- continue
133- }
134-
135132 if sess .Expiry .Before (time .Now ()) {
136133 continue
137134 }
@@ -345,24 +342,13 @@ func (s *sessionRpcServer) AddSession(ctx context.Context,
345342 }, nil
346343}
347344
348- // resumeSession tries to start an existing session if it is not expired, not
349- // revoked and a LiT session.
345+ // resumeSession tries to start the given session if it is not expired.
350346func (s * sessionRpcServer ) resumeSession (ctx context.Context ,
351347 sess * session.Session ) error {
352348
353349 pubKey := sess .LocalPublicKey
354350 pubKeyBytes := pubKey .SerializeCompressed ()
355351
356- // We only start non-revoked, non-expired LiT sessions. Everything else
357- // we just skip.
358- if sess .State != session .StateInUse &&
359- sess .State != session .StateCreated {
360-
361- log .Debugf ("Not resuming session %x with state %d" , pubKeyBytes ,
362- sess .State )
363- return nil
364- }
365-
366352 // Don't resume an expired session.
367353 if sess .Expiry .Before (time .Now ()) {
368354 log .Debugf ("Not resuming session %x with expiry %s" ,
0 commit comments