mirror of https://github.com/oxen-io/oxen-core.git
Add hard_fork to get_info rpc request
It's simple to add and saves a call to HARD_FORK_INFO when all you care about is the hf number (and not the other hard fork details).
This commit is contained in:
parent
d88d3d0de6
commit
b9f3877ab3
|
@ -372,6 +372,8 @@ namespace cryptonote { namespace rpc {
|
|||
res.top_block_hash = tools::type_to_hex(top_hash);
|
||||
res.target_height = m_core.get_target_blockchain_height();
|
||||
|
||||
res.hard_fork = m_core.get_blockchain_storage().get_network_version();
|
||||
|
||||
bool next_block_is_pulse = false;
|
||||
if (pulse::timings t; pulse::get_round_timings(m_core.get_blockchain_storage(), res.height, prev_ts, t)) {
|
||||
res.pulse_ideal_timestamp = tools::to_seconds(t.ideal_timestamp.time_since_epoch());
|
||||
|
|
|
@ -301,6 +301,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_INFO::response)
|
|||
KV_SERIALIZE(pulse_target_timestamp)
|
||||
KV_SERIALIZE(difficulty)
|
||||
KV_SERIALIZE(target)
|
||||
KV_SERIALIZE_ENUM(hard_fork)
|
||||
KV_SERIALIZE(tx_count)
|
||||
KV_SERIALIZE(tx_pool_size)
|
||||
KV_SERIALIZE(alt_blocks_count)
|
||||
|
|
|
@ -624,6 +624,7 @@ namespace rpc {
|
|||
uint64_t pulse_target_timestamp; // For pulse blocks this is the target timestamp of the next block, which targets 2 minutes after the previous block but will be slightly faster/slower if the previous block is behind/ahead of the ideal timestamp.
|
||||
uint64_t difficulty; // Network difficulty (analogous to the strength of the network).
|
||||
uint64_t target; // Current target for next proof of work.
|
||||
hf hard_fork; // Current network hard fork version
|
||||
uint64_t tx_count; // Total number of non-coinbase transaction in the chain.
|
||||
uint64_t tx_pool_size; // Number of transactions that have been broadcast but not included in a block.
|
||||
std::optional<uint64_t> alt_blocks_count; // Number of alternative blocks to main chain.
|
||||
|
|
Loading…
Reference in New Issue