1
0
Fork 0
forked from lthn/blockchain

Merge branch 'release' into develop

This commit is contained in:
sowle 2025-07-17 19:16:29 +03:00
commit 9e81e7228c
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(); time_pack_txs_ms = epee::misc_utils::get_tick_count();
currency_connection_context exclude_context = boost::value_initialized<currency_connection_context>(); currency_connection_context exclude_context = boost::value_initialized<currency_connection_context>();
NOTIFY_NEW_BLOCK::request arg = AUTO_VAL_INIT(arg); NOTIFY_NEW_BLOCK::request arg{};
arg.hop = 0;
arg.current_blockchain_height = m_blockchain_storage.get_current_blockchain_size(); arg.current_blockchain_height = m_blockchain_storage.get_current_blockchain_size();
std::list<crypto::hash> missed_txs; std::list<crypto::hash> missed_txs;
std::list<transaction> txs; std::list<transaction> txs;

View file

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

View file

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

View file

@ -8,6 +8,6 @@
#define PROJECT_REVISION "8" #define PROJECT_REVISION "8"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION #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_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]" #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"