Assumes also CHG blocks with a NULL hash without needing an info block.

Some refactoring and renaming of other hash functions to avoid misunderstanding.
This commit is contained in:
Andrea Mazzoleni 2013-08-21 22:24:12 +02:00
parent 9ad388724e
commit e0afd0edf7
6 changed files with 50 additions and 34 deletions

2
sync.c
View file

@ -280,7 +280,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
memhash(state->hash, state->hashseed, hash, buffer[j], read_size);
}
if (block_has_hash(block)) {
if (block_has_updated_hash(block)) {
/* compare the hash */
if (memcmp(hash, block->hash, HASH_SIZE) != 0) {
fprintf(stderr, "Data error in file '%s' at position '%u'\n", handle[j].path, block_file_pos(block));