Explorar o código

delete only if found in cache

Abhishek Kondur hai 1 ano
pai
achega
3cb647ab40
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      logic/extpeers.go

+ 4 - 1
logic/extpeers.go

@@ -77,7 +77,10 @@ func DeleteExtClient(network string, clientid string) error {
 	err = database.DeleteRecord(database.EXT_CLIENT_TABLE_NAME, key)
 	if err != nil {
 		if database.IsEmptyRecord(err) {
-			deleteExtClientFromCache(key)
+			if _, ok := getExtClientFromCache(key); ok {
+				deleteExtClientFromCache(key)
+				return nil
+			}
 		}
 		return err
 	}