Add cumulative difficulty to RPC block headers

This commit is contained in:
Zachary Michaels 2014-06-26 12:55:59 -04:00
parent b8874670ab
commit 760c1e3890
2 changed files with 3 additions and 0 deletions

View File

@ -571,6 +571,7 @@ namespace cryptonote
responce.difficulty = m_core.get_blockchain_storage().block_difficulty(height); responce.difficulty = m_core.get_blockchain_storage().block_difficulty(height);
responce.reward = get_block_reward(blk); responce.reward = get_block_reward(blk);
responce.tx_count = blk.tx_hashes.size(); responce.tx_count = blk.tx_hashes.size();
responce.cumulative_difficulty = m_core.get_blockchain_storage().block_cumulative_difficulty(height);
return true; return true;
} }
//------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------------

View File

@ -399,6 +399,7 @@ namespace cryptonote
difficulty_type difficulty; difficulty_type difficulty;
uint64_t reward; uint64_t reward;
size_t tx_count; size_t tx_count;
uint64_t cumulative_difficulty;
BEGIN_KV_SERIALIZE_MAP() BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(major_version) KV_SERIALIZE(major_version)
@ -413,6 +414,7 @@ namespace cryptonote
KV_SERIALIZE(difficulty) KV_SERIALIZE(difficulty)
KV_SERIALIZE(reward) KV_SERIALIZE(reward)
KV_SERIALIZE(tx_count) KV_SERIALIZE(tx_count)
KV_SERIALIZE(cumulative_difficulty)
END_KV_SERIALIZE_MAP() END_KV_SERIALIZE_MAP()
}; };