cryptonote_protocol: omit top 64 bits of difficulty when 0

This commit is contained in:
moneromooo-monero 2019-12-04 21:19:40 +00:00
parent b595583f3d
commit 9467b2e44c
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -257,7 +257,10 @@ namespace cryptonote
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(current_height)
KV_SERIALIZE(cumulative_difficulty)
if (is_store)
KV_SERIALIZE(cumulative_difficulty_top64)
else
KV_SERIALIZE_OPT(cumulative_difficulty_top64, (uint64_t)0)
KV_SERIALIZE_VAL_POD_AS_BLOB(top_id)
KV_SERIALIZE_OPT(top_version, (uint8_t)0)
KV_SERIALIZE_OPT(pruning_seed, (uint32_t)0)
@ -298,7 +301,10 @@ namespace cryptonote
KV_SERIALIZE(start_height)
KV_SERIALIZE(total_height)
KV_SERIALIZE(cumulative_difficulty)
if (is_store)
KV_SERIALIZE(cumulative_difficulty_top64)
else
KV_SERIALIZE_OPT(cumulative_difficulty_top64, (uint64_t)0)
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(m_block_ids)
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(m_block_weights)
END_KV_SERIALIZE_MAP()