From a544603a7b449026b49da48a4f323af25d2f2219 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Fri, 5 Sep 2014 18:06:08 -0400 Subject: [PATCH] Override for block hashing for block 202612 Since we need to fix tree_hash, but doing so would invalidate the block id for block 202612, this fix should check to see if we're trying to get the block id for 202612 (if its blob hash matches) and return the "old" block id, for backwards compatibility. --- src/cryptonote_core/cryptonote_format_utils.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index b37d5925c..8b9f42376 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -628,6 +628,16 @@ namespace cryptonote //--------------------------------------------------------------- bool get_block_hash(const block& b, crypto::hash& res) { + // EXCEPTION FOR BLOCK 202612 + const std::string correct_blob_hash_202612 = "3a8a2b3a29b50fc86ff73dd087ea43c6f0d6b8f936c849194d5c84c737903966"; + const std::string existing_block_id_202612 = "bbd604d2ba11ba27935e006ed39c9bfdd99b76bf4a50654bc1e1e61217962698"; + crypto::hash block_blob_hash = get_blob_hash(block_to_blob(b)); + + if (string_tools::pod_to_hex(block_blob_hash) == correct_blob_hash_202612) + { + res = string_tools::hex_to_pod(existing_block_id_202612); + return true; + } return get_object_hash(get_block_hashing_blob(b), res); } //---------------------------------------------------------------