mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
session: remove Session Group Predicate method
This was used to check that all linked sessions are no longer active before attempting to register an autopilot session. But this is no longer needed since this is done within NewSession.
This commit is contained in:
parent
013e7c081c
commit
32a34d1245
4 changed files with 1 additions and 177 deletions
|
|
@ -874,23 +874,6 @@ func (s *sessionRpcServer) AddAutopilotSession(ctx context.Context,
|
|||
"group %x", groupSess.ID, groupSess.GroupID)
|
||||
}
|
||||
|
||||
// Now we need to check that all the sessions in the group are
|
||||
// no longer active.
|
||||
ok, err := s.cfg.db.CheckSessionGroupPredicate(
|
||||
groupID, func(s *session.Session) bool {
|
||||
return s.State == session.StateRevoked ||
|
||||
s.State == session.StateExpired
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("a linked session in group "+
|
||||
"%x is still active", groupID)
|
||||
}
|
||||
|
||||
linkedGroupID = &groupID
|
||||
linkedGroupSession = groupSess
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue