rpc: fix missing target information in RPC call

which fixes the status command via RPC too.

Turns out there are two versions of the GET_INFO call.
I'd never noticed before.
This commit is contained in:
moneromooo-monero 2016-01-11 22:52:01 +00:00
parent eaf4dcd747
commit 664dc42e18
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 3 additions and 0 deletions

View file

@ -902,6 +902,7 @@ namespace cryptonote
res.height = m_core.get_current_blockchain_height();
res.target_height = m_core.get_target_blockchain_height();
res.difficulty = m_core.get_blockchain_storage().get_difficulty_for_next_block();
res.target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET;
res.tx_count = m_core.get_blockchain_storage().get_total_transactions() - res.height; //without coinbase
res.tx_pool_size = m_core.get_pool_transactions_count();
res.alt_blocks_count = m_core.get_blockchain_storage().get_alternative_blocks_count();
@ -910,6 +911,7 @@ namespace cryptonote
res.incoming_connections_count = total_conn - res.outgoing_connections_count;
res.white_peerlist_size = m_p2p.get_peerlist_manager().get_white_peers_count();
res.grey_peerlist_size = m_p2p.get_peerlist_manager().get_gray_peers_count();
res.testnet = m_testnet;
res.status = CORE_RPC_STATUS_OK;
return true;
}

View file

@ -295,6 +295,7 @@ namespace cryptonote
KV_SERIALIZE(height)
KV_SERIALIZE(target_height)
KV_SERIALIZE(difficulty)
KV_SERIALIZE(target)
KV_SERIALIZE(tx_count)
KV_SERIALIZE(tx_pool_size)
KV_SERIALIZE(alt_blocks_count)