From 5d46d6208c65c4d75f33016898d131a7e706c7ea Mon Sep 17 00:00:00 2001 From: who-biz <37732338+who-biz@users.noreply.github.com> Date: Tue, 10 Sep 2019 19:19:39 -0400 Subject: [PATCH] Blocks don't have member: '.hash' - 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. --- src/cryptonote_protocol/cryptonote_protocol_handler.inl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index f7161e8e..ab6ecfce 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -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;