diff --git a/ocdb.cpp b/ocdb.cpp index 950f423..0ca665b 100644 --- a/ocdb.cpp +++ b/ocdb.cpp @@ -286,7 +286,7 @@ Caches OCdb::get_user_caches_not_found(std::string uuid) { Caches cc; Cache c; - std::string sql = "SELECT code, location FROM caches WHERE NOT EXISTS (SELECT cache_code FROM logs WHERE cache_code = code AND type = 'Found it' and user = ?);"; + std::string sql = "SELECT code, location FROM caches WHERE status = 'Available' AND NOT EXISTS (SELECT cache_code FROM logs WHERE cache_code = code AND type = 'Found it' and user = ?);"; res = sqlite3_prepare_v2(db, sql.c_str(), sql.length() + 1, &stmt, NULL); if (res != SQLITE_OK) {