aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-04-11 00:34:03 +0200
committerRiccardo Spagni <ric@spagni.net>2017-04-11 00:34:03 +0200
commitc8dd4c58ce40d892ec1a438e0d7364f1a78c3735 (patch)
tree609e84601e04a6897435204eda25816979f9a342
parentMerge pull request #1952 (diff)
parentcore: fix blob size cache, and reenable hash and blob size caches (diff)
downloadmonero-c8dd4c58ce40d892ec1a438e0d7364f1a78c3735.tar.xz
Merge pull request #1955
5b632468 core: fix blob size cache, and reenable hash and blob size caches (moneromooo-monero)
-rw-r--r--src/cryptonote_basic/cryptonote_basic.h2
-rw-r--r--src/cryptonote_basic/cryptonote_format_utils.cpp6
2 files changed, 1 insertions, 7 deletions
diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h
index dab0d9f26..15ace2b0b 100644
--- a/src/cryptonote_basic/cryptonote_basic.h
+++ b/src/cryptonote_basic/cryptonote_basic.h
@@ -208,7 +208,7 @@ namespace cryptonote
void invalidate_hashes();
bool is_hash_valid() const { return hash_valid.load(std::memory_order_acquire); }
void set_hash_valid(bool v) const { hash_valid.store(v,std::memory_order_release); }
- bool is_blob_size_valid() const { return hash_valid.load(std::memory_order_acquire); }
+ bool is_blob_size_valid() const { return blob_size_valid.load(std::memory_order_acquire); }
void set_blob_size_valid(bool v) const { blob_size_valid.store(v,std::memory_order_release); }
BEGIN_SERIALIZE_OBJECT()
diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp
index edea8862f..745dfb72e 100644
--- a/src/cryptonote_basic/cryptonote_format_utils.cpp
+++ b/src/cryptonote_basic/cryptonote_format_utils.cpp
@@ -658,8 +658,6 @@ namespace cryptonote
//---------------------------------------------------------------
bool get_transaction_hash(const transaction& t, crypto::hash& res, size_t* blob_size)
{
- return calculate_transaction_hash(t, res, blob_size);
-#if 0
if (t.is_hash_valid())
{
#ifdef ENABLE_HASH_CASH_INTEGRITY_CHECK
@@ -690,7 +688,6 @@ namespace cryptonote
t.set_blob_size_valid(true);
}
return true;
-#endif
}
//---------------------------------------------------------------
bool get_transaction_hash(const transaction& t, crypto::hash& res, size_t& blob_size)
@@ -736,8 +733,6 @@ namespace cryptonote
//---------------------------------------------------------------
bool get_block_hash(const block& b, crypto::hash& res)
{
- return calculate_block_hash(b, res);
-#if 0
if (b.is_hash_valid())
{
#ifdef ENABLE_HASH_CASH_INTEGRITY_CHECK
@@ -754,7 +749,6 @@ namespace cryptonote
b.hash = res;
b.set_hash_valid(true);
return true;
-#endif
}
//---------------------------------------------------------------
crypto::hash get_block_hash(const block& b)