Merge pull request #4081

d95bc44 blockchain: fix getting invalid block data on failure (moneromooo-monero)
This commit is contained in:
luigi1111 2018-07-19 14:12:30 -05:00
commit 61eea83978
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -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;
}