aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-11-02 17:30:09 +0200
committerRiccardo Spagni <ric@spagni.net>2019-11-02 17:30:09 +0200
commitda31077bed2133db46c05f7030aefdb6d88d0d3b (patch)
tree54318a94f08b1aa7e1941ec980ce9af730956973 /src/cryptonote_basic/miner.h
parentMerge pull request #6051 (diff)
parentcryptonote: untangle dependency from miner to blockchain (diff)
downloadmonero-da31077bed2133db46c05f7030aefdb6d88d0d3b.tar.xz
Merge pull request #6047
ebc6ce44f cryptonote: untangle dependency from miner to blockchain (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic/miner.h')
-rw-r--r--src/cryptonote_basic/miner.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cryptonote_basic/miner.h b/src/cryptonote_basic/miner.h
index 4efbcbec3..ce50d674e 100644
--- a/src/cryptonote_basic/miner.h
+++ b/src/cryptonote_basic/miner.h
@@ -52,7 +52,7 @@ namespace cryptonote
~i_miner_handler(){};
};
- class Blockchain;
+ typedef std::function<bool(const cryptonote::block&, uint64_t, unsigned int, crypto::hash&)> get_block_hash_t;
/************************************************************************/
/* */
@@ -60,7 +60,7 @@ namespace cryptonote
class miner
{
public:
- miner(i_miner_handler* phandler, Blockchain* pbc);
+ miner(i_miner_handler* phandler, const get_block_hash_t& gbh);
~miner();
bool init(const boost::program_options::variables_map& vm, network_type nettype);
static void init_options(boost::program_options::options_description& desc);
@@ -76,7 +76,7 @@ namespace cryptonote
bool on_idle();
void on_synchronized();
//synchronous analog (for fast calls)
- static bool find_nonce_for_given_block(const Blockchain *pbc, block& bl, const difficulty_type& diffic, uint64_t height);
+ static bool find_nonce_for_given_block(const get_block_hash_t &gbh, block& bl, const difficulty_type& diffic, uint64_t height);
void pause();
void resume();
void do_print_hashrate(bool do_hr);
@@ -135,7 +135,7 @@ namespace cryptonote
std::list<boost::thread> m_threads;
epee::critical_section m_threads_lock;
i_miner_handler* m_phandler;
- Blockchain* m_pbc;
+ get_block_hash_t m_gbh;
account_public_address m_mine_address;
epee::math_helper::once_a_time_seconds<5> m_update_block_template_interval;
epee::math_helper::once_a_time_seconds<2> m_update_merge_hr_interval;