currency_protocol: there's no hop in this place anymore

This commit is contained in:
sowle 2025-07-17 19:05:35 +03:00
parent 2edb2e6fe4
commit 556746c194
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
4 changed files with 3 additions and 8 deletions

View file

@ -464,8 +464,7 @@ namespace currency
{
time_pack_txs_ms = epee::misc_utils::get_tick_count();
currency_connection_context exclude_context = boost::value_initialized<currency_connection_context>();
NOTIFY_NEW_BLOCK::request arg = AUTO_VAL_INIT(arg);
arg.hop = 0;
NOTIFY_NEW_BLOCK::request arg{};
arg.current_blockchain_height = m_blockchain_storage.get_current_blockchain_size();
std::list<crypto::hash> missed_txs;
std::list<transaction> txs;

View file

@ -58,12 +58,10 @@ namespace currency
{
block_complete_entry b;
uint64_t current_blockchain_height;
uint32_t hop;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(b)
KV_SERIALIZE(current_blockchain_height)
KV_SERIALIZE(hop)
END_KV_SERIALIZE_MAP()
};
};

View file

@ -290,7 +290,7 @@ namespace currency
}
crypto::hash block_id = get_block_hash(b);
LOG_PRINT_GREEN("[HANDLE]NOTIFY_NEW_BLOCK " << block_id << " HEIGHT " << get_block_height(b) << " (hop " << arg.hop << ")", LOG_LEVEL_2);
LOG_PRINT_GREEN("[HANDLE]NOTIFY_NEW_BLOCK " << block_id << " HEIGHT " << get_block_height(b), LOG_LEVEL_2);
CRITICAL_REGION_BEGIN(m_blocks_id_que_lock);
auto it = m_blocks_id_que.find(block_id);
@ -329,7 +329,6 @@ namespace currency
if (m_core.pre_validate_block(b, bvc, block_id) && bvc.m_added_to_main_chain)
{
//not alternative block, relay it
++arg.hop;
relay_block(arg, context);
prevalidate_relayed = true;
}
@ -377,7 +376,6 @@ namespace currency
if (true/*!prevalidate_relayed*/)
{
// pre-validation failed prevoiusly, but complete check was success, not an alternative block
++arg.hop;
//TODO: Add here announce protocol usage
relay_block(arg, context);
}

View file

@ -8,6 +8,6 @@
#define PROJECT_REVISION "7"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
#define PROJECT_VERSION_BUILD_NO 417
#define PROJECT_VERSION_BUILD_NO 418
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"