blockchain: return empty chain hashes if the start is pruned

This will still cause the peer to drop us since we're probably
no use to it, but this will happen without the peer having to wait
for a timeout first
This commit is contained in:
moneromooo-monero 2021-01-07 14:09:36 +00:00
parent e144dd5b15
commit 4868fd041e
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -2662,7 +2662,10 @@ bool Blockchain::find_blockchain_supplement(const std::list<crypto::hash>& qbloc
if (start_height < tools::get_next_unpruned_block_height(start_height, current_height, pruning_seed))
{
MDEBUG("We only have a pruned version of the common ancestor");
return false;
hashes.push_back(m_db->get_block_hash_from_height(start_height));
if (weights)
weights->push_back(m_db->get_block_weight(start_height));
return true;
}
stop_height = tools::get_next_pruned_block_height(start_height, current_height, pruning_seed);
}