Skip to content
Permalink
Browse files

rpc: add miner tx hash to block header response

  • Loading branch information...
moneromooo-monero committed Mar 21, 2019
1 parent f2f725d commit dc20d774595f95deaed30217711ff3d0ae427219
Showing with 4 additions and 1 deletion.
  1. +1 −0 src/rpc/core_rpc_server.cpp
  2. +3 −1 src/rpc/core_rpc_server_commands_defs.h
@@ -1382,6 +1382,7 @@ namespace cryptonote
response.num_txes = blk.tx_hashes.size();
response.pow_hash = fill_pow_hash ? string_tools::pod_to_hex(get_block_longhash(blk, height)) : "";
response.long_term_weight = m_core.get_blockchain_storage().get_db().get_block_long_term_weight(height);
response.miner_tx_hash = string_tools::pod_to_hex(cryptonote::get_transaction_hash(blk.miner_tx));
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
@@ -84,7 +84,7 @@ namespace cryptonote
// advance which version they will stop working with
// Don't go over 32767 for any of these
#define CORE_RPC_VERSION_MAJOR 2
#define CORE_RPC_VERSION_MINOR 4
#define CORE_RPC_VERSION_MINOR 5
#define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor))
#define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR)

@@ -1234,6 +1234,7 @@ namespace cryptonote
uint64_t num_txes;
std::string pow_hash;
uint64_t long_term_weight;
std::string miner_tx_hash;

BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(major_version)
@@ -1253,6 +1254,7 @@ namespace cryptonote
KV_SERIALIZE(num_txes)
KV_SERIALIZE(pow_hash)
KV_SERIALIZE_OPT(long_term_weight, (uint64_t)0)
KV_SERIALIZE(miner_tx_hash)
END_KV_SERIALIZE_MAP()
};

0 comments on commit dc20d77

Please sign in to comment.
You can’t perform that action at this time.