mirror of
https://github.com/monero-project/monero.git
synced 2025-06-07 04:22:42 -04:00
Merge pull request #1938
bff90264
Add expected total reward to RPC "getblocktemplate". Only works from V5 fork onward - returns 0 before that block. (assylias)
This commit is contained in:
commit
acbe0b4849
10 changed files with 19 additions and 12 deletions
|
@ -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;
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace cryptonote
|
|||
struct i_miner_handler
|
||||
{
|
||||
virtual bool handle_block_found(block& b) = 0;
|
||||
virtual bool get_block_template(block& b, const account_public_address& adr, difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce) = 0;
|
||||
virtual bool get_block_template(block& b, const account_public_address& adr, difficulty_type& diffic, uint64_t& height, uint64_t& expected_reward, const blobdata& ex_nonce) = 0;
|
||||
protected:
|
||||
~i_miner_handler(){};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue