diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-07-19 14:12:30 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-07-19 14:12:30 -0500 |
commit | 61eea839786149e587f939bcdb1c40009638845f (patch) | |
tree | c1d9eb4a4b075306979d92ee18d2c670cf932ea6 /src/cryptonote_core | |
parent | Merge pull request #4076 (diff) | |
parent | blockchain: fix getting invalid block data on failure (diff) | |
download | monero-61eea839786149e587f939bcdb1c40009638845f.tar.xz |
Merge pull request #4081
d95bc44 blockchain: fix getting invalid block data on failure (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 3 |
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; } |