aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-20 10:58:41 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-05 11:58:00 +0000
commit07d655e438e1b1e05426a5c75627f5d8c63bbc72 (patch)
tree4646753c9418a1d55cbf8dfd848690639e690e0c /src/cryptonote_core
parentcore: avoid calculating tx prefix hash when we don't need it (diff)
downloadmonero-07d655e438e1b1e05426a5c75627f5d8c63bbc72.tar.xz
blockchain: avoid duplicate block hash computation
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index a15fda093..0379ab760 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -3474,11 +3474,10 @@ leave:
#if defined(PER_BLOCK_CHECKPOINT)
if (m_db->height() < m_blocks_hash_check.size())
{
- auto hash = get_block_hash(bl);
const auto &expected_hash = m_blocks_hash_check[m_db->height()];
if (expected_hash != crypto::null_hash)
{
- if (memcmp(&hash, &expected_hash, sizeof(hash)) != 0)
+ if (memcmp(&id, &expected_hash, sizeof(hash)) != 0)
{
MERROR_VER("Block with id is INVALID: " << id << ", expected " << expected_hash);
bvc.m_verifivation_failed = true;