Commit 78883ee2 authored by Pierre Kim's avatar Pierre Kim

Add difficulty information to f_block_short_response

parent dd0f2571
......@@ -30,6 +30,7 @@ struct STATUS_STRUCT {
struct f_block_short_response {
uint64_t timestamp;
uint64_t difficulty;
uint32_t height;
std::string hash;
uint64_t tx_count;
......@@ -37,10 +38,11 @@ struct f_block_short_response {
void serialize(ISerializer &s) {
KV_MEMBER(timestamp)
KV_MEMBER(height)
KV_MEMBER(hash)
KV_MEMBER(cumul_size)
KV_MEMBER(tx_count)
KV_MEMBER(difficulty)
KV_MEMBER(height)
KV_MEMBER(hash)
KV_MEMBER(cumul_size)
KV_MEMBER(tx_count)
}
};
......
......@@ -672,11 +672,14 @@ bool RpcServer::f_on_blocks_list_json(const COMMAND_RPC_BLOCKS_LIST_JSON::reques
//BlockDetails blkDetails = m_core.getBlockDetails(block_hash);
size_t blkSize;
difficulty_type difficulty;
m_core.getBlockSize(block_hash, blkSize);
m_core.getBlockDifficulty(i, difficulty);
f_block_short_response block_short;
block_short.cumul_size = blkSize;
block_short.timestamp = blk.timestamp;
block_short.difficulty = difficulty;
block_short.height = i;
block_short.hash = Common::podToHex(block_hash);
block_short.tx_count = blk.transactionHashes.size() + 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment