mirror of
https://github.com/monero-project/monero.git
synced 2025-07-28 13:24:12 -04:00
protocol: pass blockchain cumulative difficulty when syncing
Not used yet.
This commit is contained in:
parent
9e6bcbc014
commit
827afcb7ea
8 changed files with 30 additions and 0 deletions
|
@ -197,11 +197,13 @@ namespace cryptonote
|
|||
struct CORE_SYNC_DATA
|
||||
{
|
||||
uint64_t current_height;
|
||||
uint64_t cumulative_difficulty;
|
||||
crypto::hash top_id;
|
||||
uint8_t top_version;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(current_height)
|
||||
KV_SERIALIZE(cumulative_difficulty)
|
||||
KV_SERIALIZE_VAL_POD_AS_BLOB(top_id)
|
||||
KV_SERIALIZE_OPT(top_version, (uint8_t)0)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
|
@ -229,11 +231,13 @@ namespace cryptonote
|
|||
{
|
||||
uint64_t start_height;
|
||||
uint64_t total_height;
|
||||
uint64_t cumulative_difficulty;
|
||||
std::list<crypto::hash> m_block_ids;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(start_height)
|
||||
KV_SERIALIZE(total_height)
|
||||
KV_SERIALIZE(cumulative_difficulty)
|
||||
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(m_block_ids)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
|
|
@ -309,6 +309,7 @@ namespace cryptonote
|
|||
{
|
||||
m_core.get_blockchain_top(hshd.current_height, hshd.top_id);
|
||||
hshd.top_version = m_core.get_hard_fork_version(hshd.current_height);
|
||||
hshd.cumulative_difficulty = m_core.get_block_cumulative_difficulty(hshd.current_height);
|
||||
hshd.current_height +=1;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue