@@ -101,7 +101,10 @@ func newSessionRPCServer(cfg *sessionRpcServerConfig) (*sessionRpcServer,
101
101
// requests. This includes resuming all non-revoked sessions.
102
102
func (s * sessionRpcServer ) start (ctx context.Context ) error {
103
103
// Start up all previously created sessions.
104
- sessions , err := s .cfg .db .ListAllSessions ()
104
+ sessions , err := s .cfg .db .ListSessionsByState (
105
+ session .StateCreated ,
106
+ session .StateInUse ,
107
+ )
105
108
if err != nil {
106
109
return fmt .Errorf ("error listing sessions: %v" , err )
107
110
}
@@ -126,12 +129,6 @@ func (s *sessionRpcServer) start(ctx context.Context) error {
126
129
continue
127
130
}
128
131
129
- if sess .State != session .StateInUse &&
130
- sess .State != session .StateCreated {
131
-
132
- continue
133
- }
134
-
135
132
if sess .Expiry .Before (time .Now ()) {
136
133
continue
137
134
}
@@ -345,24 +342,13 @@ func (s *sessionRpcServer) AddSession(ctx context.Context,
345
342
}, nil
346
343
}
347
344
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.
350
346
func (s * sessionRpcServer ) resumeSession (ctx context.Context ,
351
347
sess * session.Session ) error {
352
348
353
349
pubKey := sess .LocalPublicKey
354
350
pubKeyBytes := pubKey .SerializeCompressed ()
355
351
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
-
366
352
// Don't resume an expired session.
367
353
if sess .Expiry .Before (time .Now ()) {
368
354
log .Debugf ("Not resuming session %x with expiry %s" ,
0 commit comments