Electroneum
Loading...
Searching...
No Matches
cryptonote::miner Class Reference

#include <miner.h>

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 104 of file miner.cpp.

104 :m_stop(1),
105 m_template(boost::value_initialized<block>()),
106 m_template_no(0),
107 m_diffic(0),
108 m_thread_index(0),
109 m_phandler(phandler),
110 m_height(0),
111 m_threads_active(0),
112 m_pausers_count(0),
113 m_threads_total(0),
114 m_starter_nonce(0),
115 m_last_hr_merge_time(0),
116 m_hashes(0),
117 m_total_hashes(0),
118 m_do_print_hashrate(false),
119 m_do_mining(false),
120 m_current_hash_rate(0),
121 m_is_background_mining_enabled(false),
126 m_block_reward(0)
127 {
128 m_attrs.set_stack_size(THREAD_STACK_SIZE);
129 }
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 131 of file miner.cpp.

132 {
133 try { stop(); }
134 catch (...) { /* ignore */ }
135 }
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 199 of file miner.cpp.

200 {
201 m_do_print_hashrate = do_hr;
202 }

◆ 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 478 of file miner.cpp.

479 {
480 for(; bl.nonce != std::numeric_limits<uint32_t>::max(); bl.nonce++)
481 {
482 crypto::hash h;
484
485 if(check_hash(h, diffic))
486 {
487 bl.invalidate_hashes();
488 return true;
489 }
490 }
491 bl.invalidate_hashes();
492 return false;
493 }
uint64_t height
POD_CLASS hash
Definition hash.h:50
bool check_hash(const crypto::hash &hash, difficulty_type difficulty)
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 652 of file miner.cpp.

653 {
654 return m_idle_threshold;
655 }
Here is the caller graph for this function:

◆ get_ignore_battery()

bool cryptonote::miner::get_ignore_battery ( ) const

Definition at line 616 of file miner.cpp.

617 {
618 return m_ignore_battery;
619 }
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 611 of file miner.cpp.

612 {
613 return m_is_background_mining_enabled;
614 }
Here is the caller graph for this function:

◆ get_min_idle_seconds()

uint64_t cryptonote::miner::get_min_idle_seconds ( ) const

Definition at line 639 of file miner.cpp.

640 {
641 return m_min_idle_seconds;
642 }
Here is the caller graph for this function:

◆ get_mining_address()

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

Definition at line 364 of file miner.cpp.

365 {
366 return m_mine_address;
367 }
Here is the caller graph for this function:

◆ get_mining_target()

uint8_t cryptonote::miner::get_mining_target ( ) const

Definition at line 665 of file miner.cpp.

666 {
667 return m_mining_target;
668 }
Here is the caller graph for this function:

◆ get_speed()

uint64_t cryptonote::miner::get_speed ( ) const

Definition at line 429 of file miner.cpp.

430 {
431 if(is_mining()) {
432 return m_current_hash_rate;
433 }
434 else {
435 return 0;
436 }
437 }
bool is_mining() const
Definition miner.cpp:359
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 369 of file miner.cpp.

369 {
370 return m_threads_total;
371 }
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 292 of file miner.cpp.

293 {
294 if(command_line::has_arg(vm, arg_extra_messages))
295 {
296 std::string buff;
297 bool r = file_io_utils::load_file_to_string(command_line::get_arg(vm, arg_extra_messages), buff);
298 CHECK_AND_ASSERT_MES(r, false, "Failed to load file with extra messages: " << command_line::get_arg(vm, arg_extra_messages));
299 std::vector<std::string> extra_vec;
300 boost::split(extra_vec, buff, boost::is_any_of("\n"), boost::token_compress_on );
301 m_extra_messages.resize(extra_vec.size());
302 for(size_t i = 0; i != extra_vec.size(); i++)
303 {
304 string_tools::trim(extra_vec[i]);
305 if(!extra_vec[i].size())
306 continue;
307 std::string buff = string_encoding::base64_decode(extra_vec[i]);
308 if(buff != "0")
309 m_extra_messages[i] = buff;
310 }
311 m_config_folder_path = boost::filesystem::path(command_line::get_arg(vm, arg_extra_messages)).parent_path().string();
312 m_config = AUTO_VAL_INIT(m_config);
313 const std::string filename = m_config_folder_path + "/" + MINER_CONFIG_FILE_NAME;
314 CHECK_AND_ASSERT_MES(epee::serialization::load_t_from_json_file(m_config, filename), false, "Failed to load data from " << filename);
315 MINFO("Loaded " << m_extra_messages.size() << " extra messages, current index " << m_config.current_extra_message_index);
316 }
317
318 if(command_line::has_arg(vm, arg_start_mining))
319 {
320 address_parse_info info;
321 if(!cryptonote::get_account_address_from_str(info, nettype, command_line::get_arg(vm, arg_start_mining)) || info.is_subaddress)
322 {
323 LOG_ERROR("Target account address " << command_line::get_arg(vm, arg_start_mining) << " has wrong format, starting daemon canceled");
324 return false;
325 }
326 // just a safeguard for the legacy infrastructure
327 if(!(command_line::get_arg(vm, arg_start_mining) == "etnkCys4uGhSi9h48ajL9vBDJTcn2s2ttXtXq3SXWPAbiMHNhHitu5fJ8QgRfFWTzmJ8QgRfFWTzmJ8QgRfFWTzm4t51HTfCtK"))
328 {
329 LOG_ERROR("Target account address " << command_line::get_arg(vm, arg_start_mining) << " isn't equal to the Aurelius legacy mining burn address etnkCys4uGhSi9h48ajL9vBDJTcn2s2ttXtXq3SXWPAbiMHNhHitu5fJ8QgRfFWTzmJ8QgRfFWTzmJ8QgRfFWTzm4t51HTfCtK");
330 return false;
331 }
332 m_mine_address = info.address;
333 m_threads_total = 1;
334 m_do_mining = true;
335 if(command_line::has_arg(vm, arg_mining_threads))
336 {
337 m_threads_total = command_line::get_arg(vm, arg_mining_threads);
338 }
339 }
340
341 // Background mining parameters
342 // Let init set all parameters even if background mining is not enabled, they can start later with params set
343 if(command_line::has_arg(vm, arg_bg_mining_enable))
344 set_is_background_mining_enabled( command_line::get_arg(vm, arg_bg_mining_enable) );
345 if(command_line::has_arg(vm, arg_bg_mining_ignore_battery))
346 set_ignore_battery( command_line::get_arg(vm, arg_bg_mining_ignore_battery) );
347 if(command_line::has_arg(vm, arg_bg_mining_min_idle_interval_seconds))
348 set_min_idle_seconds( command_line::get_arg(vm, arg_bg_mining_min_idle_interval_seconds) );
349 if(command_line::has_arg(vm, arg_bg_mining_idle_threshold_percentage))
350 set_idle_threshold( command_line::get_arg(vm, arg_bg_mining_idle_threshold_percentage) );
351 if(command_line::has_arg(vm, arg_bg_mining_miner_target_percentage))
352 set_mining_target( command_line::get_arg(vm, arg_bg_mining_miner_target_percentage) );
353
354 m_fallback_to_pow = fallback_to_pow;
355
356 return true;
357 }
bool set_min_idle_seconds(uint64_t min_idle_seconds)
Definition miner.cpp:644
bool set_idle_threshold(uint8_t idle_threshold)
Definition miner.cpp:657
bool set_mining_target(uint8_t mining_target)
Definition miner.cpp:670
#define MINER_CONFIG_FILE_NAME
#define AUTO_VAL_INIT(v)
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
#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)
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
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)
CXA_THROW_INFO_T * info
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 280 of file miner.cpp.

281 {
282 command_line::add_arg(desc, arg_extra_messages);
283 command_line::add_arg(desc, arg_start_mining);
284 command_line::add_arg(desc, arg_mining_threads);
285 command_line::add_arg(desc, arg_bg_mining_enable);
286 command_line::add_arg(desc, arg_bg_mining_ignore_battery);
287 command_line::add_arg(desc, arg_bg_mining_min_idle_interval_seconds);
288 command_line::add_arg(desc, arg_bg_mining_idle_threshold_percentage);
289 command_line::add_arg(desc, arg_bg_mining_miner_target_percentage);
290 }
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
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 359 of file miner.cpp.

360 {
361 return !m_stop;
362 }
Here is the caller graph for this function:

◆ on_block_chain_update()

bool cryptonote::miner::on_block_chain_update ( )

Definition at line 149 of file miner.cpp.

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

◆ on_idle()

bool cryptonote::miner::on_idle ( )

Definition at line 179 of file miner.cpp.

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

◆ on_synchronized()

void cryptonote::miner::on_synchronized ( )

Definition at line 495 of file miner.cpp.

496 {
497 if(m_do_mining)
498 {
499 start(m_mine_address, m_threads_total, get_is_background_mining_enabled(), get_ignore_battery());
500 }
501 }
bool get_ignore_battery() const
Definition miner.cpp:616
bool get_is_background_mining_enabled() const
Definition miner.cpp:611
bool start(const account_public_address &adr, size_t threads_count, bool do_background=false, bool ignore_battery=false)
Definition miner.cpp:373
Here is the call graph for this function:

◆ pause()

void cryptonote::miner::pause ( )

Definition at line 503 of file miner.cpp.

504 {
505 CRITICAL_REGION_LOCAL(m_miners_count_lock);
506 MDEBUG("miner::pause: " << m_pausers_count << " -> " << (m_pausers_count + 1));
507 ++m_pausers_count;
508 if(m_pausers_count == 1 && is_mining())
509 MDEBUG("MINING PAUSED");
510 }
#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:

◆ resume()

void cryptonote::miner::resume ( )

Definition at line 512 of file miner.cpp.

513 {
514 CRITICAL_REGION_LOCAL(m_miners_count_lock);
515 MDEBUG("miner::resume: " << m_pausers_count << " -> " << (m_pausers_count - 1));
516 --m_pausers_count;
517 if(m_pausers_count < 0)
518 {
519 m_pausers_count = 0;
520 }
521 if(!m_pausers_count && is_mining())
522 MDEBUG("MINING RESUMED");
523 }
Here is the call graph for this function:

◆ send_stop_signal()

void cryptonote::miner::send_stop_signal ( )

Definition at line 439 of file miner.cpp.

440 {
441 boost::interprocess::ipcdetail::atomic_write32(&m_stop, 1);
442 }
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 137 of file miner.cpp.

138 {
139 CRITICAL_REGION_LOCAL(m_template_lock);
140 m_template = bl;
141 m_diffic = di;
142 m_height = height;
143 m_block_reward = block_reward;
144 ++m_template_no;
145 m_starter_nonce = crypto::rand<uint32_t>();
146 return true;
147 }
std::enable_if< std::is_pod< T >::value, T >::type rand()
Definition crypto.h:216
Here is the call graph for this function:

◆ set_idle_threshold()

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

Definition at line 657 of file miner.cpp.

658 {
659 if(idle_threshold > BACKGROUND_MINING_MAX_IDLE_THRESHOLD_PERCENTAGE) return false;
660 if(idle_threshold < BACKGROUND_MINING_MIN_IDLE_THRESHOLD_PERCENTAGE) return false;
661 m_idle_threshold = idle_threshold;
662 return true;
663 }
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 644 of file miner.cpp.

645 {
646 if(min_idle_seconds > BACKGROUND_MINING_MAX_MIN_IDLE_INTERVAL_IN_SECONDS) return false;
647 if(min_idle_seconds < BACKGROUND_MINING_MIN_MIN_IDLE_INTERVAL_IN_SECONDS) return false;
648 m_min_idle_seconds = min_idle_seconds;
649 return true;
650 }
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 670 of file miner.cpp.

671 {
672 if(mining_target > BACKGROUND_MINING_MAX_MINING_TARGET_PERCENTAGE) return false;
673 if(mining_target < BACKGROUND_MINING_MIN_MINING_TARGET_PERCENTAGE) return false;
674 m_mining_target = mining_target;
675 return true;
676 }
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 373 of file miner.cpp.

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

445 {
446 MTRACE("Miner has received stop signal");
447
448 CRITICAL_REGION_LOCAL(m_threads_lock);
449 bool mining = !m_threads.empty();
450 if (!mining)
451 {
452 MTRACE("Not mining - nothing to stop" );
453 return true;
454 }
455
457
458 // In case background mining was active and the miner threads are waiting
459 // on the background miner to signal start.
460 while (m_threads_active > 0)
461 {
462 m_is_background_mining_started_cond.notify_all();
464 }
465
466 // The background mining thread could be sleeping for a long time, so we
467 // interrupt it just in case
468 m_background_mining_thread.interrupt();
469 m_background_mining_thread.join();
470 m_is_background_mining_enabled = false;
471
472 MINFO("Mining has been stopped, " << m_threads.size() << " finished" );
473 m_threads.clear();
474 m_threads_autodetect.clear();
475 return true;
476 }
void send_stop_signal()
Definition miner.cpp:439
#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

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

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

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

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

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

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

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

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

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

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

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

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:
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/cryptonote_basic/miner.h
  • /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/cryptonote_basic/miner.cpp