aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-17 17:55:32 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-17 17:55:32 +0200
commit429930534df43b8bef46a4a39dbfbc3d3b5939b0 (patch)
tree0280220db27a66d12d16e3b42a003cebab00177a /src/cryptonote_basic/miner.cpp
parentMerge pull request #5182 (diff)
parentdaemon: new mining_status command (diff)
downloadmonero-429930534df43b8bef46a4a39dbfbc3d3b5939b0.tar.xz
Merge pull request #5185
59478c80 daemon: new mining_status command (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic/miner.cpp')
-rw-r--r--src/cryptonote_basic/miner.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp
index 7fc720f8a..6628c8448 100644
--- a/src/cryptonote_basic/miner.cpp
+++ b/src/cryptonote_basic/miner.cpp
@@ -119,7 +119,8 @@ namespace cryptonote
m_min_idle_seconds(BACKGROUND_MINING_DEFAULT_MIN_IDLE_INTERVAL_IN_SECONDS),
m_idle_threshold(BACKGROUND_MINING_DEFAULT_IDLE_THRESHOLD_PERCENTAGE),
m_mining_target(BACKGROUND_MINING_DEFAULT_MINING_TARGET_PERCENTAGE),
- m_miner_extra_sleep(BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS)
+ m_miner_extra_sleep(BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS),
+ m_block_reward(0)
{
}
@@ -130,12 +131,13 @@ namespace cryptonote
catch (...) { /* ignore */ }
}
//-----------------------------------------------------------------------------------------------------
- bool miner::set_block_template(const block& bl, const difficulty_type& di, uint64_t height)
+ bool miner::set_block_template(const block& bl, const difficulty_type& di, uint64_t height, uint64_t block_reward)
{
CRITICAL_REGION_LOCAL(m_template_lock);
m_template = bl;
m_diffic = di;
m_height = height;
+ m_block_reward = block_reward;
++m_template_no;
m_starter_nonce = crypto::rand<uint32_t>();
return true;
@@ -167,7 +169,7 @@ namespace cryptonote
LOG_ERROR("Failed to get_block_template(), stopping mining");
return false;
}
- set_block_template(bl, di, height);
+ set_block_template(bl, di, height, expected_reward);
return true;
}
//-----------------------------------------------------------------------------------------------------
@@ -359,6 +361,7 @@ namespace cryptonote
//-----------------------------------------------------------------------------------------------------
bool miner::start(const account_public_address& adr, size_t threads_count, const boost::thread::attributes& attrs, bool do_background, bool ignore_battery)
{
+ m_block_reward = 0;
m_mine_address = adr;
m_threads_total = static_cast<uint32_t>(threads_count);
if (threads_count == 0)