blockchain: fix getting invalid block data on failure

This commit is contained in:
moneromooo-monero 2018-06-29 15:49:49 +01:00
parent a9b83f5a6e
commit d95bc44c6b
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -2217,7 +2217,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;
}