aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-07-19 14:12:30 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-07-19 14:12:30 -0500
commit61eea839786149e587f939bcdb1c40009638845f (patch)
treec1d9eb4a4b075306979d92ee18d2c670cf932ea6
parentMerge pull request #4076 (diff)
parentblockchain: fix getting invalid block data on failure (diff)
downloadmonero-61eea839786149e587f939bcdb1c40009638845f.tar.xz
Merge pull request #4081
d95bc44 blockchain: fix getting invalid block data on failure (moneromooo-monero)
-rw-r--r--src/cryptonote_core/blockchain.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index a92711208..6e35744e6 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -2257,7 +2257,8 @@ bool Blockchain::find_blockchain_supplement(const std::list<crypto::hash>& qbloc
CRITICAL_REGION_LOCAL(m_blockchain_lock);
bool result = find_blockchain_supplement(qblock_ids, resp.m_block_ids, resp.start_height, resp.total_height);
- resp.cumulative_difficulty = m_db->get_block_cumulative_difficulty(resp.total_height - 1);
+ if (result)
+ resp.cumulative_difficulty = m_db->get_block_cumulative_difficulty(resp.total_height - 1);
return result;
}