From bac19b3c9498c5ff50e1cc58d077ea1a25423557 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 7 May 2013 15:47:43 +0100 Subject: [PATCH] [btree_checker] no longer need to check the checksum, since the block validator has already done this. --- .../data-structures/btree_checker.h | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/persistent-data/data-structures/btree_checker.h b/persistent-data/data-structures/btree_checker.h index 80ea189..9055c1e 100644 --- a/persistent-data/data-structures/btree_checker.h +++ b/persistent-data/data-structures/btree_checker.h @@ -93,7 +93,6 @@ namespace persistent_data { bool check_internal(node_location const &loc, btree_detail::node_ref const &n) { if (!already_visited(n) && - check_sum(n) && check_block_nr(n) && check_max_entries(n) && check_nr_entries(n, loc.sub_root) && @@ -112,7 +111,6 @@ namespace persistent_data { bool check_leaf(node_location const &loc, btree_detail::node_ref const &n) { if (!already_visited(n) && - check_sum(n) && check_block_nr(n) && check_max_entries(n) && check_nr_entries(n, loc.sub_root) && @@ -144,24 +142,6 @@ namespace persistent_data { return false; } - template - bool check_sum(node const &n) const { - crc32c sum(BTREE_CSUM_XOR); - - disk_node const *data = n.raw(); - sum.append(&data->header.flags, MD_BLOCK_SIZE - sizeof(uint32_t)); - if (sum.get_sum() != n.get_checksum()) { - std::ostringstream out; - out << "checksum error for block " << n.get_block_nr() - << ", sum was " << sum.get_sum() - << ", on disk " << n.get_checksum(); - errs_->add_child(out.str()); - return false; - } - - return true; - } - template bool check_block_nr(node const &n) const { if (n.get_location() != n.get_block_nr()) {