Merge pull request #1552 from darcys22/coinbase-payouts

Rename miner_reward to coinbase_payouts and fix minor bug
This commit is contained in:
Sean 2022-05-27 11:09:20 +10:00 committed by GitHub
commit 5175503098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 8 deletions

View File

@ -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;
}

View File

@ -1836,13 +1836,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());

View File

@ -422,7 +422,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)

View File

@ -816,7 +816,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.