Merge pull request #5650

3c071d2 blockchain: silence an error getting blocks for pruned nodes (moneromooo-monero)
This commit is contained in:
luigi1111 2019-07-04 14:44:05 -05:00
commit 59ba0eee69
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

View File

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