watchtower/wtserver/server: permit unused session overrwite

This commit is contained in:
Conner Fromknecht committed 2019-04-23 20:06:04 -07:00
1 parent 9b1bc9fd79
commit 978a0a8de6
3 files changed
+76 -10

No files matched your search

+2 -1
View File
@@ -61,7 +61,8 @@ func (db *MockDB) InsertSessionInfo(info *SessionInfo) error {
db.mu.Lock()
defer db.mu.Unlock()
if _, ok := db.sessions[info.ID]; ok {
dbInfo, ok := db.sessions[info.ID]
if ok && dbInfo.LastApplied > 0 {
return ErrSessionAlreadyExists
}