aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-11-01 17:03:58 +0200
committerRiccardo Spagni <ric@spagni.net>2019-11-01 17:03:58 +0200
commit8cc7d5b6c0c611dd03eba21c9cc7a9a043fa7b04 (patch)
treea2ef779b7187e93ed6d0948abc845c6c7718c197 /src/cryptonote_basic/miner.cpp
parentMerge pull request #6064 (diff)
parentcryptonote: untangle dependency from miner to blockchain (diff)
downloadmonero-8cc7d5b6c0c611dd03eba21c9cc7a9a043fa7b04.tar.xz
Merge pull request #6066
d31024c2e cryptonote: untangle dependency from miner to blockchain (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic/miner.cpp')
-rw-r--r--src/cryptonote_basic/miner.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp
index c4b5c8455..688aeaea3 100644
--- a/src/cryptonote_basic/miner.cpp
+++ b/src/cryptonote_basic/miner.cpp
@@ -102,13 +102,13 @@ namespace cryptonote
}
- miner::miner(i_miner_handler* phandler, Blockchain* pbc):m_stop(1),
+ miner::miner(i_miner_handler* phandler, const get_block_hash_t &gbh):m_stop(1),
m_template{},
m_template_no(0),
m_diffic(0),
m_thread_index(0),
m_phandler(phandler),
- m_pbc(pbc),
+ m_gbh(gbh),
m_height(0),
m_threads_active(0),
m_pausers_count(0),
@@ -471,12 +471,12 @@ namespace cryptonote
return true;
}
//-----------------------------------------------------------------------------------------------------
- bool miner::find_nonce_for_given_block(const Blockchain *pbc, block& bl, const difficulty_type& diffic, uint64_t height)
+ bool miner::find_nonce_for_given_block(const get_block_hash_t &gbh, block& bl, const difficulty_type& diffic, uint64_t height)
{
for(; bl.nonce != std::numeric_limits<uint32_t>::max(); bl.nonce++)
{
crypto::hash h;
- get_block_longhash(pbc, bl, h, height, tools::get_max_concurrency());
+ gbh(bl, height, tools::get_max_concurrency(), h);
if(check_hash(h, diffic))
{
@@ -572,7 +572,7 @@ namespace cryptonote
b.nonce = nonce;
crypto::hash h;
- get_block_longhash(m_pbc, b, h, height, tools::get_max_concurrency());
+ m_gbh(b, height, tools::get_max_concurrency(), h);
if(check_hash(h, local_diff))
{