Skip to content

Commit

Permalink
Fix wrong block hash during sync
Browse files Browse the repository at this point in the history
- Whatever is causing this issue is now causing a different error with message 'construct null invalid'
- However, this seems to be better, as it at least stops the loop
  • Loading branch information
who-biz committed Aug 28, 2019
1 parent 3103e1a commit 5f5f886
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cryptonote_protocol/cryptonote_protocol_handler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
#include <boost/interprocess/detail/atomic.hpp>
#include <list>
#include <ctime>
#include <iostream>

#include "cryptonote_basic/cryptonote_format_utils.h"
#include "profile_tools.h"
#include "common/hex_str.h"
#include "net/network_throttle-detail.hpp"

#undef MONERO_DEFAULT_LOG_CATEGORY
Expand Down Expand Up @@ -1026,9 +1028,11 @@ skip:
bool parent_requested = m_block_queue.requested(new_block.prev_id);
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 << " with unknown parent " << new_block.prev_id << " which was not requested - querying block hashes");
LOG_ERROR_CCONTEXT("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 5f5f886

Please sign in to comment.