diff options
author | Thomas Winget <tewinget@gmail.com> | 2014-09-05 18:06:08 -0400 |
---|---|---|
committer | fluffypony <ric@spagni.net> | 2014-09-06 21:54:58 +0200 |
commit | a544603a7b449026b49da48a4f323af25d2f2219 (patch) | |
tree | a9c93fdf8bf127bc68da58739767aa382b97a5a2 /src/cryptonote_core | |
parent | Merge pull request #112 from fluffypony/master (diff) | |
download | monero-a544603a7b449026b49da48a4f323af25d2f2219.tar.xz |
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.
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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); } //--------------------------------------------------------------- |