Electroneum
cryptonote::miner Class Reference

#include <miner.h>

Collaboration diagram for cryptonote::miner:

Public Member Functions

 miner (i_miner_handler *phandler)
 
 ~miner ()
 
bool init (const boost::program_options::variables_map &vm, network_type nettype, bool fallback_to_pow=false)
 
bool set_block_template (const block &bl, const difficulty_type &diffic, uint64_t height, uint64_t block_reward)
 
bool on_block_chain_update ()
 
bool start (const account_public_address &adr, size_t threads_count, bool do_background=false, bool ignore_battery=false)
 
uint64_t get_speed () const
 
uint32_t get_threads_count () const
 
void send_stop_signal ()
 
bool stop ()
 
bool is_mining () const
 
const account_public_addressget_mining_address () const
 
bool on_idle ()
 
void on_synchronized ()
 
void pause ()
 
void resume ()
 
void do_print_hashrate (bool do_hr)
 
bool get_is_background_mining_enabled () const
 
bool get_ignore_battery () const
 
uint64_t get_min_idle_seconds () const
 
bool set_min_idle_seconds (uint64_t min_idle_seconds)
 
uint8_t get_idle_threshold () const
 
bool set_idle_threshold (uint8_t idle_threshold)
 
uint8_t get_mining_target () const
 
bool set_mining_target (uint8_t mining_target)
 
uint64_t get_block_reward () const
 

Static Public Member Functions

static void init_options (boost::program_options::options_description &desc)
 
static bool find_nonce_for_given_block (block &bl, const difficulty_type &diffic, uint64_t height)
 

Static Public Attributes

static constexpr uint8_t BACKGROUND_MINING_DEFAULT_IDLE_THRESHOLD_PERCENTAGE = 90
 
static constexpr uint8_t BACKGROUND_MINING_MIN_IDLE_THRESHOLD_PERCENTAGE = 50
 
static constexpr uint8_t BACKGROUND_MINING_MAX_IDLE_THRESHOLD_PERCENTAGE = 99
 
static constexpr uint16_t BACKGROUND_MINING_DEFAULT_MIN_IDLE_INTERVAL_IN_SECONDS = 10
 
static constexpr uint16_t BACKGROUND_MINING_MIN_MIN_IDLE_INTERVAL_IN_SECONDS = 10
 
static constexpr uint16_t BACKGROUND_MINING_MAX_MIN_IDLE_INTERVAL_IN_SECONDS = 3600
 
static constexpr uint8_t BACKGROUND_MINING_DEFAULT_MINING_TARGET_PERCENTAGE = 40
 
static constexpr uint8_t BACKGROUND_MINING_MIN_MINING_TARGET_PERCENTAGE = 5
 
static constexpr uint8_t BACKGROUND_MINING_MAX_MINING_TARGET_PERCENTAGE = 50
 
static constexpr uint8_t BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS = 10
 
static constexpr uint64_t BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS = 400
 
static constexpr uint64_t BACKGROUND_MINING_MIN_MINER_EXTRA_SLEEP_MILLIS = 5
 

Detailed Description

Definition at line 59 of file miner.h.

Constructor & Destructor Documentation

◆ miner()

cryptonote::miner::miner ( i_miner_handler phandler)

Definition at line 103 of file miner.cpp.

103  :m_stop(1),
104  m_template(boost::value_initialized<block>()),
105  m_template_no(0),
106  m_diffic(0),
107  m_thread_index(0),
108  m_phandler(phandler),
109  m_height(0),
110  m_threads_active(0),
111  m_pausers_count(0),
112  m_threads_total(0),
113  m_starter_nonce(0),
114  m_last_hr_merge_time(0),
115  m_hashes(0),
116  m_total_hashes(0),
117  m_do_print_hashrate(false),
118  m_do_mining(false),
119  m_current_hash_rate(0),
120  m_is_background_mining_enabled(false),
125  m_block_reward(0)
126  {
127  m_attrs.set_stack_size(THREAD_STACK_SIZE);
128  }
static constexpr uint8_t BACKGROUND_MINING_DEFAULT_IDLE_THRESHOLD_PERCENTAGE
Definition: miner.h:92
static constexpr uint16_t BACKGROUND_MINING_DEFAULT_MIN_IDLE_INTERVAL_IN_SECONDS
Definition: miner.h:95
static constexpr uint8_t BACKGROUND_MINING_DEFAULT_MINING_TARGET_PERCENTAGE
Definition: miner.h:98
static constexpr uint64_t BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS
Definition: miner.h:102
#define THREAD_STACK_SIZE

◆ ~miner()

cryptonote::miner::~miner ( )

Definition at line 130 of file miner.cpp.

131  {
132  try { stop(); }
133  catch (...) { /* ignore */ }
134  }
Here is the call graph for this function:

Member Function Documentation

◆ do_print_hashrate()

void cryptonote::miner::do_print_hashrate ( bool  do_hr)

Definition at line 198 of file miner.cpp.

199  {
200  m_do_print_hashrate = do_hr;
201  }

◆ find_nonce_for_given_block()

bool cryptonote::miner::find_nonce_for_given_block ( block bl,
const difficulty_type diffic,
uint64_t  height 
)
static

Definition at line 471 of file miner.cpp.

472  {
473  for(; bl.nonce != std::numeric_limits<uint32_t>::max(); bl.nonce++)
474  {
475  crypto::hash h;
476  get_block_longhash(bl, h, height);
477 
478  if(check_hash(h, diffic))
479  {
480  bl.invalidate_hashes();
481  return true;
482  }
483  }
484  bl.invalidate_hashes();
485  return false;
486  }
uint64_t height
Definition: blockchain.cpp:91
POD_CLASS hash
Definition: hash.h:50
bool check_hash(const crypto::hash &hash, difficulty_type difficulty)
Definition: difficulty.cpp:203
bool get_block_longhash(const block &b, crypto::hash &res, uint64_t height)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_block_reward()

uint64_t cryptonote::miner::get_block_reward ( ) const
inline

Definition at line 90 of file miner.h.

90 { return m_block_reward; }
Here is the caller graph for this function:

◆ get_idle_threshold()

uint8_t cryptonote::miner::get_idle_threshold ( ) const

Definition at line 645 of file miner.cpp.

646  {
647  return m_idle_threshold;
648  }
Here is the caller graph for this function:

◆ get_ignore_battery()

bool cryptonote::miner::get_ignore_battery ( ) const

Definition at line 609 of file miner.cpp.

610  {
611  return m_ignore_battery;
612  }
Here is the caller graph for this function:

◆ get_is_background_mining_enabled()

bool cryptonote::miner::get_is_background_mining_enabled ( ) const

Definition at line 604 of file miner.cpp.

605  {
606  return m_is_background_mining_enabled;
607  }
Here is the caller graph for this function:

◆ get_min_idle_seconds()

uint64_t cryptonote::miner::get_min_idle_seconds ( ) const

Definition at line 632 of file miner.cpp.

633  {
634  return m_min_idle_seconds;
635  }
Here is the caller graph for this function:

◆ get_mining_address()

const account_public_address & cryptonote::miner::get_mining_address ( ) const

Definition at line 357 of file miner.cpp.

358  {
359  return m_mine_address;
360  }
Here is the caller graph for this function:

◆ get_mining_target()

uint8_t cryptonote::miner::get_mining_target ( ) const

Definition at line 658 of file miner.cpp.

659  {
660  return m_mining_target;
661  }
Here is the caller graph for this function:

◆ get_speed()

uint64_t cryptonote::miner::get_speed ( ) const

Definition at line 422 of file miner.cpp.

423  {
424  if(is_mining()) {
425  return m_current_hash_rate;
426  }
427  else {
428  return 0;
429  }
430  }
bool is_mining() const
Definition: miner.cpp:352
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_threads_count()

uint32_t cryptonote::miner::get_threads_count ( ) const

Definition at line 362 of file miner.cpp.

362  {
363  return m_threads_total;
364  }
Here is the caller graph for this function:

◆ init()

bool cryptonote::miner::init ( const boost::program_options::variables_map &  vm,
network_type  nettype,
bool  fallback_to_pow = false 
)

Definition at line 291 of file miner.cpp.

292  {
293  if(command_line::has_arg(vm, arg_extra_messages))
294  {
295  std::string buff;
296  bool r = file_io_utils::load_file_to_string(command_line::get_arg(vm, arg_extra_messages), buff);
297  CHECK_AND_ASSERT_MES(r, false, "Failed to load file with extra messages: " << command_line::get_arg(vm, arg_extra_messages));
298  std::vector<std::string> extra_vec;
299  boost::split(extra_vec, buff, boost::is_any_of("\n"), boost::token_compress_on );
300  m_extra_messages.resize(extra_vec.size());
301  for(size_t i = 0; i != extra_vec.size(); i++)
302  {
303  string_tools::trim(extra_vec[i]);
304  if(!extra_vec[i].size())
305  continue;
306  std::string buff = string_encoding::base64_decode(extra_vec[i]);
307  if(buff != "0")
308  m_extra_messages[i] = buff;
309  }
310  m_config_folder_path = boost::filesystem::path(command_line::get_arg(vm, arg_extra_messages)).parent_path().string();
311  m_config = AUTO_VAL_INIT(m_config);
312  const std::string filename = m_config_folder_path + "/" + MINER_CONFIG_FILE_NAME;
313  CHECK_AND_ASSERT_MES(epee::serialization::load_t_from_json_file(m_config, filename), false, "Failed to load data from " << filename);
314  MINFO("Loaded " << m_extra_messages.size() << " extra messages, current index " << m_config.current_extra_message_index);
315  }
316 
317  if(command_line::has_arg(vm, arg_start_mining))
318  {
319  address_parse_info info;
320  if(!cryptonote::get_account_address_from_str(info, nettype, command_line::get_arg(vm, arg_start_mining)) || info.is_subaddress)
321  {
322  LOG_ERROR("Target account address " << command_line::get_arg(vm, arg_start_mining) << " has wrong format, starting daemon canceled");
323  return false;
324  }
325  m_mine_address = info.address;
326  m_threads_total = 1;
327  m_do_mining = true;
328  if(command_line::has_arg(vm, arg_mining_threads))
329  {
330  m_threads_total = command_line::get_arg(vm, arg_mining_threads);
331  }
332  }
333 
334  // Background mining parameters
335  // Let init set all parameters even if background mining is not enabled, they can start later with params set
336  if(command_line::has_arg(vm, arg_bg_mining_enable))
337  set_is_background_mining_enabled( command_line::get_arg(vm, arg_bg_mining_enable) );
338  if(command_line::has_arg(vm, arg_bg_mining_ignore_battery))
339  set_ignore_battery( command_line::get_arg(vm, arg_bg_mining_ignore_battery) );
340  if(command_line::has_arg(vm, arg_bg_mining_min_idle_interval_seconds))
341  set_min_idle_seconds( command_line::get_arg(vm, arg_bg_mining_min_idle_interval_seconds) );
342  if(command_line::has_arg(vm, arg_bg_mining_idle_threshold_percentage))
343  set_idle_threshold( command_line::get_arg(vm, arg_bg_mining_idle_threshold_percentage) );
344  if(command_line::has_arg(vm, arg_bg_mining_miner_target_percentage))
345  set_mining_target( command_line::get_arg(vm, arg_bg_mining_miner_target_percentage) );
346 
347  m_fallback_to_pow = fallback_to_pow;
348 
349  return true;
350  }
bool set_min_idle_seconds(uint64_t min_idle_seconds)
Definition: miner.cpp:637
bool set_idle_threshold(uint8_t idle_threshold)
Definition: miner.cpp:650
bool set_mining_target(uint8_t mining_target)
Definition: miner.cpp:663
#define MINER_CONFIG_FILE_NAME
#define AUTO_VAL_INIT(v)
Definition: misc_language.h:53
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
Definition: misc_log_ex.h:181
#define LOG_ERROR(x)
Definition: misc_log_ex.h:98
#define MINFO(x)
Definition: misc_log_ex.h:75
std::enable_if<!std::is_same< T, bool >::value, bool >::type has_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg)
Definition: command_line.h:258
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
Definition: command_line.h:271
bool get_account_address_from_str(address_parse_info &info, network_type nettype, std::string const &str)
bool load_file_to_string(const std::string &path_to_file, std::string &target_str, size_t max_size=1000000000)
bool load_t_from_json_file(t_struct &out, const std::string &json_file)
std::string base64_decode(std::string const &encoded_string)
std::string & trim(std::string &str)
Definition: string_tools.h:288
::std::string string
Definition: gtest-port.h:1097
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:91
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_options()

void cryptonote::miner::init_options ( boost::program_options::options_description &  desc)
static

Definition at line 279 of file miner.cpp.

280  {
281  command_line::add_arg(desc, arg_extra_messages);
282  command_line::add_arg(desc, arg_start_mining);
283  command_line::add_arg(desc, arg_mining_threads);
284  command_line::add_arg(desc, arg_bg_mining_enable);
285  command_line::add_arg(desc, arg_bg_mining_ignore_battery);
286  command_line::add_arg(desc, arg_bg_mining_min_idle_interval_seconds);
287  command_line::add_arg(desc, arg_bg_mining_idle_threshold_percentage);
288  command_line::add_arg(desc, arg_bg_mining_miner_target_percentage);
289  }
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
Definition: command_line.h:188
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_mining()

bool cryptonote::miner::is_mining ( ) const

Definition at line 352 of file miner.cpp.

353  {
354  return !m_stop;
355  }
Here is the caller graph for this function:

◆ on_block_chain_update()

bool cryptonote::miner::on_block_chain_update ( )

Definition at line 148 of file miner.cpp.

149  {
150  if(!is_mining())
151  return true;
152 
153  return request_block_template();
154  }
Here is the call graph for this function:

◆ on_idle()

bool cryptonote::miner::on_idle ( )

Definition at line 178 of file miner.cpp.

179  {
180  m_update_block_template_interval.do_call([&](){
181  if(is_mining())request_block_template();
182  return true;
183  });
184 
185  m_update_merge_hr_interval.do_call([&](){
186  merge_hr();
187  return true;
188  });
189 
190  m_autodetect_interval.do_call([&](){
191  update_autodetection();
192  return true;
193  });
194 
195  return true;
196  }
bool do_call(functor_t functr)
Definition: math_helper.h:263
Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_synchronized()

void cryptonote::miner::on_synchronized ( )

Definition at line 488 of file miner.cpp.

489  {
490  if(m_do_mining)
491  {
492  start(m_mine_address, m_threads_total, get_is_background_mining_enabled(), get_ignore_battery());
493  }
494  }
bool get_ignore_battery() const
Definition: miner.cpp:609
bool get_is_background_mining_enabled() const
Definition: miner.cpp:604
bool start(const account_public_address &adr, size_t threads_count, bool do_background=false, bool ignore_battery=false)
Definition: miner.cpp:366
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pause()

void cryptonote::miner::pause ( )

Definition at line 496 of file miner.cpp.

497  {
498  CRITICAL_REGION_LOCAL(m_miners_count_lock);
499  MDEBUG("miner::pause: " << m_pausers_count << " -> " << (m_pausers_count + 1));
500  ++m_pausers_count;
501  if(m_pausers_count == 1 && is_mining())
502  MDEBUG("MINING PAUSED");
503  }
#define MDEBUG(x)
Definition: misc_log_ex.h:76
#define CRITICAL_REGION_LOCAL(x)
Definition: syncobj.h:228
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resume()

void cryptonote::miner::resume ( )

Definition at line 505 of file miner.cpp.

506  {
507  CRITICAL_REGION_LOCAL(m_miners_count_lock);
508  MDEBUG("miner::resume: " << m_pausers_count << " -> " << (m_pausers_count - 1));
509  --m_pausers_count;
510  if(m_pausers_count < 0)
511  {
512  m_pausers_count = 0;
513  }
514  if(!m_pausers_count && is_mining())
515  MDEBUG("MINING RESUMED");
516  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_stop_signal()

void cryptonote::miner::send_stop_signal ( )

Definition at line 432 of file miner.cpp.

433  {
434  boost::interprocess::ipcdetail::atomic_write32(&m_stop, 1);
435  }
Here is the caller graph for this function:

◆ set_block_template()

bool cryptonote::miner::set_block_template ( const block bl,
const difficulty_type diffic,
uint64_t  height,
uint64_t  block_reward 
)

Definition at line 136 of file miner.cpp.

137  {
138  CRITICAL_REGION_LOCAL(m_template_lock);
139  m_template = bl;
140  m_diffic = di;
141  m_height = height;
142  m_block_reward = block_reward;
143  ++m_template_no;
144  m_starter_nonce = crypto::rand<uint32_t>();
145  return true;
146  }

◆ set_idle_threshold()

bool cryptonote::miner::set_idle_threshold ( uint8_t  idle_threshold)

Definition at line 650 of file miner.cpp.

651  {
652  if(idle_threshold > BACKGROUND_MINING_MAX_IDLE_THRESHOLD_PERCENTAGE) return false;
653  if(idle_threshold < BACKGROUND_MINING_MIN_IDLE_THRESHOLD_PERCENTAGE) return false;
654  m_idle_threshold = idle_threshold;
655  return true;
656  }
static constexpr uint8_t BACKGROUND_MINING_MAX_IDLE_THRESHOLD_PERCENTAGE
Definition: miner.h:94
static constexpr uint8_t BACKGROUND_MINING_MIN_IDLE_THRESHOLD_PERCENTAGE
Definition: miner.h:93
Here is the caller graph for this function:

◆ set_min_idle_seconds()

bool cryptonote::miner::set_min_idle_seconds ( uint64_t  min_idle_seconds)

Definition at line 637 of file miner.cpp.

638  {
639  if(min_idle_seconds > BACKGROUND_MINING_MAX_MIN_IDLE_INTERVAL_IN_SECONDS) return false;
640  if(min_idle_seconds < BACKGROUND_MINING_MIN_MIN_IDLE_INTERVAL_IN_SECONDS) return false;
641  m_min_idle_seconds = min_idle_seconds;
642  return true;
643  }
static constexpr uint16_t BACKGROUND_MINING_MIN_MIN_IDLE_INTERVAL_IN_SECONDS
Definition: miner.h:96
static constexpr uint16_t BACKGROUND_MINING_MAX_MIN_IDLE_INTERVAL_IN_SECONDS
Definition: miner.h:97
Here is the caller graph for this function:

◆ set_mining_target()

bool cryptonote::miner::set_mining_target ( uint8_t  mining_target)

Definition at line 663 of file miner.cpp.

664  {
665  if(mining_target > BACKGROUND_MINING_MAX_MINING_TARGET_PERCENTAGE) return false;
666  if(mining_target < BACKGROUND_MINING_MIN_MINING_TARGET_PERCENTAGE) return false;
667  m_mining_target = mining_target;
668  return true;
669  }
static constexpr uint8_t BACKGROUND_MINING_MAX_MINING_TARGET_PERCENTAGE
Definition: miner.h:100
static constexpr uint8_t BACKGROUND_MINING_MIN_MINING_TARGET_PERCENTAGE
Definition: miner.h:99
Here is the caller graph for this function:

◆ start()

bool cryptonote::miner::start ( const account_public_address adr,
size_t  threads_count,
bool  do_background = false,
bool  ignore_battery = false 
)

Definition at line 366 of file miner.cpp.

367  {
368  m_block_reward = 0;
369  m_mine_address = adr;
370  m_threads_total = static_cast<uint32_t>(threads_count);
371  if (threads_count == 0)
372  {
373  m_threads_autodetect.clear();
374  m_threads_autodetect.push_back({epee::misc_utils::get_ns_count(), m_total_hashes});
375  m_threads_total = 1;
376  }
377  m_starter_nonce = crypto::rand<uint32_t>();
378  CRITICAL_REGION_LOCAL(m_threads_lock);
379  if(is_mining())
380  {
381  LOG_ERROR("Starting miner but it's already started");
382  return false;
383  }
384 
385  if(!m_threads.empty())
386  {
387  LOG_ERROR("Unable to start miner because there are active mining threads");
388  return false;
389  }
390 
391  request_block_template();//lets update block template
392 
393  boost::interprocess::ipcdetail::atomic_write32(&m_stop, 0);
394  boost::interprocess::ipcdetail::atomic_write32(&m_thread_index, 0);
395  set_is_background_mining_enabled(do_background);
396  set_ignore_battery(ignore_battery);
397 
398  for(size_t i = 0; i != m_threads_total; i++)
399  {
400  m_threads.push_back(boost::thread(m_attrs, boost::bind(&miner::worker_thread, this)));
401  }
402 
403  if (threads_count == 0)
404  MINFO("Mining has started, autodetecting optimal number of threads, good luck!" );
405  else
406  MINFO("Mining has started with " << threads_count << " threads, good luck!" );
407 
409  {
410  m_background_mining_thread = boost::thread(m_attrs, boost::bind(&miner::background_worker_thread, this));
411  LOG_PRINT_L0("Background mining controller thread started" );
412  }
413 
414  if(get_ignore_battery())
415  {
416  MINFO("Ignoring battery");
417  }
418 
419  return true;
420  }
#define LOG_PRINT_L0(x)
Definition: misc_log_ex.h:99
uint64_t get_ns_count()
unsigned int uint32_t
Definition: stdint.h:126
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop()

bool cryptonote::miner::stop ( )

Definition at line 437 of file miner.cpp.

438  {
439  MTRACE("Miner has received stop signal");
440 
441  CRITICAL_REGION_LOCAL(m_threads_lock);
442  bool mining = !m_threads.empty();
443  if (!mining)
444  {
445  MTRACE("Not mining - nothing to stop" );
446  return true;
447  }
448 
450 
451  // In case background mining was active and the miner threads are waiting
452  // on the background miner to signal start.
453  while (m_threads_active > 0)
454  {
455  m_is_background_mining_started_cond.notify_all();
457  }
458 
459  // The background mining thread could be sleeping for a long time, so we
460  // interrupt it just in case
461  m_background_mining_thread.interrupt();
462  m_background_mining_thread.join();
463  m_is_background_mining_enabled = false;
464 
465  MINFO("Mining has been stopped, " << m_threads.size() << " finished" );
466  m_threads.clear();
467  m_threads_autodetect.clear();
468  return true;
469  }
void send_stop_signal()
Definition: miner.cpp:432
#define MTRACE(x)
Definition: misc_log_ex.h:77
bool sleep_no_w(long ms)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ BACKGROUND_MINING_DEFAULT_IDLE_THRESHOLD_PERCENTAGE

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_DEFAULT_IDLE_THRESHOLD_PERCENTAGE = 90
staticconstexpr

Definition at line 92 of file miner.h.

◆ BACKGROUND_MINING_DEFAULT_MIN_IDLE_INTERVAL_IN_SECONDS

constexpr uint16_t cryptonote::miner::BACKGROUND_MINING_DEFAULT_MIN_IDLE_INTERVAL_IN_SECONDS = 10
staticconstexpr

Definition at line 95 of file miner.h.

◆ BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS

constexpr uint64_t cryptonote::miner::BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS = 400
staticconstexpr

Definition at line 102 of file miner.h.

◆ BACKGROUND_MINING_DEFAULT_MINING_TARGET_PERCENTAGE

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_DEFAULT_MINING_TARGET_PERCENTAGE = 40
staticconstexpr

Definition at line 98 of file miner.h.

◆ BACKGROUND_MINING_MAX_IDLE_THRESHOLD_PERCENTAGE

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_MAX_IDLE_THRESHOLD_PERCENTAGE = 99
staticconstexpr

Definition at line 94 of file miner.h.

◆ BACKGROUND_MINING_MAX_MIN_IDLE_INTERVAL_IN_SECONDS

constexpr uint16_t cryptonote::miner::BACKGROUND_MINING_MAX_MIN_IDLE_INTERVAL_IN_SECONDS = 3600
staticconstexpr

Definition at line 97 of file miner.h.

◆ BACKGROUND_MINING_MAX_MINING_TARGET_PERCENTAGE

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_MAX_MINING_TARGET_PERCENTAGE = 50
staticconstexpr

Definition at line 100 of file miner.h.

◆ BACKGROUND_MINING_MIN_IDLE_THRESHOLD_PERCENTAGE

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_MIN_IDLE_THRESHOLD_PERCENTAGE = 50
staticconstexpr

Definition at line 93 of file miner.h.

◆ BACKGROUND_MINING_MIN_MIN_IDLE_INTERVAL_IN_SECONDS

constexpr uint16_t cryptonote::miner::BACKGROUND_MINING_MIN_MIN_IDLE_INTERVAL_IN_SECONDS = 10
staticconstexpr

Definition at line 96 of file miner.h.

◆ BACKGROUND_MINING_MIN_MINER_EXTRA_SLEEP_MILLIS

constexpr uint64_t cryptonote::miner::BACKGROUND_MINING_MIN_MINER_EXTRA_SLEEP_MILLIS = 5
staticconstexpr

Definition at line 103 of file miner.h.

◆ BACKGROUND_MINING_MIN_MINING_TARGET_PERCENTAGE

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_MIN_MINING_TARGET_PERCENTAGE = 5
staticconstexpr

Definition at line 99 of file miner.h.

◆ BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS

constexpr uint8_t cryptonote::miner::BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS = 10
staticconstexpr

Definition at line 101 of file miner.h.


The documentation for this class was generated from the following files: