Skip to content

Commit

Permalink
Blocks don't have member: '.hash'
Browse files Browse the repository at this point in the history
- For some reason, the macro LOG_ERROR_CCONTEXT was ignoring the fact that block structures don't have a field called 'hash', only previous id's.
  • Loading branch information
who-biz committed Sep 10, 2019
1 parent dcd82f5 commit 5d46d62
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cryptonote_protocol/cryptonote_protocol_handler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1029,10 +1029,8 @@ skip:
if (!parent_requested)
{
std::ostringstream new_block_hash(NULL);
epee::to_hex::formatted(new_block_hash, epee::as_byte_span(new_block.hash));
// this can happen if a connection was sicced onto a late span, if it did not have those blocks,
// since we don't know that at the sic time
LOG_ERROR_CCONTEXT("Got block " << new_block_hash.str() << " with unknown parent " << new_block.prev_id << " which was not requested - querying block hashes");
epee::to_hex::formatted(new_block_hash, epee::as_byte_span(get_block_hash(new_block)));
MERROR("Got block " << new_block_hash.str() << " with unknown parent " << new_block.prev_id << " which was not requested - querying block hashes");
context.m_needed_objects.clear();
context.m_last_response_height = 0;
goto skip;
Expand Down

0 comments on commit 5d46d62

Please sign in to comment.