tdb2: unify tdb1_store into tdb_store
[ccan] / ccan / tdb2 / tdb.c
index 57b0777845e78805ff56298fd10517b4c8f351cb..5e92af8c9666ac4c443af53638fb1c822229179c 100644 (file)
@@ -284,6 +284,10 @@ bool tdb_exists(struct tdb_context *tdb, TDB_DATA key)
        struct tdb_used_record rec;
        struct hash_info h;
 
+       if (tdb->flags & TDB_VERSION1) {
+               return tdb1_exists(tdb, key);
+       }
+
        off = find_and_lock(tdb, key, F_RDLCK, &h, &rec, NULL);
        if (TDB_OFF_IS_ERR(off)) {
                tdb->last_error = off;