1
0
Fork 0
forked from lthn/blockchain

rpc: last_block_hash and last_block_timestamp added to getinfo result

This commit is contained in:
sowle 2019-03-02 13:33:28 +03:00
parent 620f346ff5
commit 32d42b6f50
2 changed files with 6 additions and 0 deletions

View file

@ -156,6 +156,8 @@ namespace currency
m_core.get_blockchain_storage().get_top_block(b);
res.last_block_total_reward = currency::get_reward_from_miner_tx(b.miner_tx);
res.pos_diff_total_coins_rate = (pos_diff / (res.total_coins - PREMINE_AMOUNT + 1)).convert_to<uint64_t>();
res.last_block_timestamp = b.timestamp;
res.last_block_hash = string_tools::pod_to_hex(get_block_hash(b));
}
if (req.flags&COMMAND_RPC_GET_INFO_FLAG_POS_BLOCK_TS_SHIFT_VS_ACTUAL)
{

View file

@ -660,6 +660,8 @@ namespace currency
uint64_t tx_count_in_last_block;
uint64_t default_fee;
uint64_t minimum_fee;
uint64_t last_block_timestamp;
std::string last_block_hash;
//market
uint64_t offers_count;
@ -708,6 +710,8 @@ namespace currency
KV_SERIALIZE(tx_count_in_last_block)
KV_SERIALIZE(default_fee)
KV_SERIALIZE(minimum_fee)
KV_SERIALIZE(last_block_timestamp)
KV_SERIALIZE(last_block_hash)
KV_SERIALIZE(offers_count)
END_KV_SERIALIZE_MAP()
};