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
No known key found for this signature in database
GPG key ID: F0B50DA956B249B0
10 changed files with 19 additions and 12 deletions

View file

@ -122,13 +122,15 @@ namespace cryptonote
block bl = AUTO_VAL_INIT(bl);
difficulty_type di = AUTO_VAL_INIT(di);
uint64_t height = AUTO_VAL_INIT(height);
uint64_t expected_reward; //only used for RPC calls - could possibly be useful here too?
cryptonote::blobdata extra_nonce;
if(m_extra_messages.size() && m_config.current_extra_message_index < m_extra_messages.size())
{
extra_nonce = m_extra_messages[m_config.current_extra_message_index];
}
if(!m_phandler->get_block_template(bl, m_mine_address, di, height, extra_nonce))
if(!m_phandler->get_block_template(bl, m_mine_address, di, height, expected_reward, extra_nonce))
{
LOG_ERROR("Failed to get_block_template(), stopping mining");
return false;