mirror of https://github.com/oxen-io/oxen-core.git
Rename miner_reward to coinbase_payouts and fix minor bug
After the batching HF we now have a "reward" field in the block header which is confusingly different to "miner_reward". This renames miner_reward to coinbase_payouts to clarify that this amount is the amount actually paid out in the coinbase vs the reward accumulated into the batching DB. Also fixes a minor bug where the reward would only show the reward of the first vout instead of summing all the vouts.
This commit is contained in:
parent
c7deef4ac3
commit
47a9802f83
|
@ -136,7 +136,7 @@ namespace {
|
|||
<< "long term weight: " << header.long_term_weight << "\n"
|
||||
<< "num txes: " << header.num_txes << "\n"
|
||||
<< "reward: " << cryptonote::print_money(header.reward) << "\n"
|
||||
<< "miner reward: " << cryptonote::print_money(header.miner_reward) << "\n"
|
||||
<< "coinbase payouts: " << cryptonote::print_money(header.coinbase_payouts) << "\n"
|
||||
<< "service node winner: " << header.service_node_winner << "\n"
|
||||
<< "miner tx hash: " << header.miner_tx_hash;
|
||||
}
|
||||
|
|
|
@ -1834,13 +1834,9 @@ namespace cryptonote { namespace rpc {
|
|||
response.pow_hash = tools::type_to_hex(get_block_longhash_w_blockchain(m_core.get_nettype(), &(m_core.get_blockchain_storage()), blk, height, 0));
|
||||
response.long_term_weight = m_core.get_blockchain_storage().get_db().get_block_long_term_weight(height);
|
||||
response.service_node_winner = (tools::type_to_hex(blk.service_node_winner_key) == "") ? tools::type_to_hex(cryptonote::get_service_node_winner_from_tx_extra(blk.miner_tx.extra)) : tools::type_to_hex(blk.service_node_winner_key);
|
||||
response.coinbase_payouts = get_block_reward(blk);
|
||||
if (blk.miner_tx.vout.size() > 0)
|
||||
{
|
||||
response.miner_reward = blk.miner_tx.vout[0].amount;
|
||||
response.miner_tx_hash = tools::type_to_hex(cryptonote::get_transaction_hash(blk.miner_tx));
|
||||
} else {
|
||||
response.miner_reward = get_block_reward(blk);
|
||||
}
|
||||
if (get_tx_hashes)
|
||||
{
|
||||
response.tx_hashes.reserve(blk.tx_hashes.size());
|
||||
|
|
|
@ -421,7 +421,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(block_header_response)
|
|||
KV_SERIALIZE(difficulty)
|
||||
KV_SERIALIZE(cumulative_difficulty)
|
||||
KV_SERIALIZE(reward)
|
||||
KV_SERIALIZE(miner_reward)
|
||||
KV_SERIALIZE(coinbase_payouts)
|
||||
KV_SERIALIZE(block_size)
|
||||
KV_SERIALIZE_OPT(block_weight, (uint64_t)0)
|
||||
KV_SERIALIZE(num_txes)
|
||||
|
|
|
@ -815,7 +815,7 @@ namespace rpc {
|
|||
difficulty_type difficulty; // The strength of the Loki network based on mining power.
|
||||
difficulty_type cumulative_difficulty; // The cumulative strength of the Loki network based on mining power.
|
||||
uint64_t reward; // The amount of new generated in this block and rewarded to the miner, foundation and service Nodes. Note: 1 OXEN = 1e9 atomic units.
|
||||
uint64_t miner_reward; // The amount of new generated in this block and rewarded to the miner. Note: 1 OXEN = 1e9 atomic units.
|
||||
uint64_t coinbase_payouts; // The amount of new generated in this block and rewarded to the miner. Note: 1 OXEN = 1e9 atomic units.
|
||||
uint64_t block_size; // The block size in bytes.
|
||||
uint64_t block_weight; // The block weight in bytes.
|
||||
uint64_t num_txes; // Number of transactions in the block, not counting the coinbase tx.
|
||||
|
|
Loading…
Reference in New Issue