- if (tdb->hash_fn(&key) != rec->full_hash) {
- TDB1_LOG((tdb, TDB1_DEBUG_ERROR,
- "Record offset %d has incorrect hash\n", off));
+ if ((uint32_t)tdb_hash(tdb, key.dptr, key.dsize) != rec->full_hash) {
+ tdb->last_error = tdb_logerr(tdb, TDB_ERR_CORRUPT, TDB_LOG_ERROR,
+ "Record offset %d has incorrect hash\n", off);