Add expected total reward to RPC "getblocktemplate".

Only works from V5 fork onward - returns 0 before that block.
This commit is contained in:
assylias
2017-03-28 15:55:38 +01:00
parent 9ed496bbc5
commit bff90264b8
10 changed files with 19 additions and 12 deletions

View File

@@ -1072,7 +1072,7 @@ uint64_t Blockchain::get_current_cumulative_blocksize_limit() const
// in a lot of places. That flag is not referenced in any of the code
// nor any of the makefiles, howeve. Need to look into whether or not it's
// necessary at all.
bool Blockchain::create_block_template(block& b, const account_public_address& miner_address, difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce)
bool Blockchain::create_block_template(block& b, const account_public_address& miner_address, difficulty_type& diffic, uint64_t& height, uint64_t& expected_reward, const blobdata& ex_nonce)
{
LOG_PRINT_L3("Blockchain::" << __func__);
size_t median_size;
@@ -1096,7 +1096,7 @@ bool Blockchain::create_block_template(block& b, const account_public_address& m
size_t txs_size;
uint64_t fee;
if (!m_tx_pool.fill_block_template(b, median_size, already_generated_coins, txs_size, fee, m_hardfork->get_current_version()))
if (!m_tx_pool.fill_block_template(b, median_size, already_generated_coins, txs_size, fee, expected_reward, m_hardfork->get_current_version()))
{
return false;
}