blockchain: silence an error getting blocks for pruned nodes

This happens often when a pre-pruning node asks a pruned node
for data it does not have
This commit is contained in:
moneromooo-monero 2019-06-16 10:57:38 +00:00 committed by wowario
parent 2e9b9d92fc
commit f15de92f90
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
1 changed files with 8 additions and 4 deletions

View File

@ -1951,10 +1951,14 @@ bool Blockchain::handle_get_objects(NOTIFY_REQUEST_GET_OBJECTS::request& arg, NO
if (missed_tx_ids.size() != 0)
{
LOG_ERROR("Error retrieving blocks, missed " << missed_tx_ids.size()
<< " transactions for block with hash: " << get_block_hash(bl.second)
<< std::endl
);
// do not display an error if the peer asked for an unpruned block which we are not meant to have
if (tools::has_unpruned_block(get_block_height(bl.second), get_current_blockchain_height(), get_blockchain_pruning_seed()))
{
LOG_ERROR("Error retrieving blocks, missed " << missed_tx_ids.size()
<< " transactions for block with hash: " << get_block_hash(bl.second)
<< std::endl
);
}
// append missed transaction hashes to response missed_ids field,
// as done below if any standalone transactions were requested