aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.cpp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-27core: fix mining from a block that's not the current topmoneromooo-monero1-4/+6
2020-05-06Update copyright year to 2020SomaticFanatic1-1/+1
Update copyright year to 2020
2020-02-06miner: use verification mode for low diff one block nonce searchesmoneromooo-monero1-1/+1
This avoids lengthy init times when testing
2019-10-31cryptonote: untangle dependency from miner to blockchainmoneromooo-monero1-5/+5
It causes link errors at least on mac
2019-10-13Add also ifdef __x86_64__pkubaj1-2/+2
2019-10-13Fix build on FreeBSD/!x86pkubaj1-0/+4
Checking battery status uses x86-only headers and functions. Remove this functionality to get it to build on other architectures.
2019-09-25RandomX integrationHoward Chu1-4/+9
Support RandomX PoW algorithm
2019-09-05Make null hash constants constexprLev Sizov1-1/+1
Simplify m_template initialization in miner
2019-09-02Removed unused boost/value_init headerLev Sizov1-1/+0
2019-09-02Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez1-1/+1
2019-07-02miner: fix --bg-mining-enable descriptionmoneromooo-monero1-1/+1
2019-06-09miner: fix double free of thread attributesston1th1-9/+5
issue: #5568
2019-04-15Increment m_threads_active when mining thread startsDoyle1-0/+1
2019-04-11functional_tests: add more blockchain related testsmoneromooo-monero1-1/+2
Related to emission, reorgs, getting tx data back, output distribution and histogram
2019-04-11Merge pull request #5381Riccardo Spagni1-6/+9
def40161 miner: fix race when stopping mining with start mining enabled (moneromooo-monero)
2019-04-04wallet: new option to start background miningmoneromooo-monero1-5/+11
The setup-background-mining option can be used to select background mining when a wallet loads. The user will be asked the first time the wallet is created.
2019-04-01miner: fix race when stopping mining with start mining enabledmoneromooo-monero1-6/+9
2019-04-01Merge pull request #5288Riccardo Spagni1-2/+3
39f000b3 miner: fix possible exit crash due to race in stop (moneromooo-monero)
2019-03-17Merge pull request #5185Riccardo Spagni1-3/+6
59478c80 daemon: new mining_status command (moneromooo-monero)
2019-03-14miner: fix possible exit crash due to race in stopmoneromooo-monero1-2/+3
If a thread asks to stop the miner, m_stop will be set, and that thread will wait to join. If the main thread is exiting at that time, it will ask the miner to stop, but the miner will claim it's not mining and early out since m_stop is set. This will cause the database and other things to get shutdown. If the miner happens to find a block at that time, it will try to call core, and crash. Instead, lock and check whether any threads are currently in m_threads, since they'll only be cleared once the threads are joined. Moreover, since we lock, the second thread will have to wait for the first one to have finished. Calling join twice on a thread seems fine as per pthread_join(3).
2019-03-09daemon: new mining_status commandmoneromooo-monero1-3/+6
2019-03-05Update 2019 copyrightbinaryFate1-1/+1
2019-03-04check load_t_from_json return valuesmoneromooo-monero1-1/+2
2019-02-23miner: it can now autodetect the optimal number of threadsmoneromooo-monero1-4/+79
2018-12-04Merge pull request #4869Riccardo Spagni1-1/+1
60f36386 Avoid unnecessary temp block and copy ctor (moneromooo-monero)
2018-11-19Avoid unnecessary temp block and copy ctormoneromooo-monero1-1/+1
block already has a default ctor, and the extra object churn due to its innards (vectors, etc) is pointless.
2018-11-15Removed a lot of unnecessary includesMartijn Otto1-15/+16
2018-10-22miner: fix build with boost 1.69moneromooo-monero1-1/+1
2018-10-08miner: really reset flags/precision on std::coutmoneromooo-monero1-1/+1
2018-09-29Merge pull request #4459Riccardo Spagni1-2/+4
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero) 3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero) a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero) 1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero) fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero) 2e2139ff epee: do not propagate exception through dtor (moneromooo-monero) 0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero) 1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero) 418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero) ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero) 6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero) 53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero) e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero) 661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero) 5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero) 7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero) a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero) d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero) 02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero) c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-07-19Merge pull request #4030luigi11111-1/+1
0c41488 miner: show id and height when a block is found (stoffu)
2018-06-20miner: show id and height when a block is foundstoffu1-1/+1
2018-05-06handle optional miner params bettercryptochangements341-0/+5
2018-03-15Fix typos in various filesDimitris Apostolou1-1/+1
2018-03-05Merge pull request #3277Riccardo Spagni1-2/+2
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu) af773211 Stagenet (stoffu) cc9a0bee command_line: allow args to depend on more than one args (stoffu) 55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu) 450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu) 9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
2018-03-05Correct spelling mistakes.Edward Betts1-1/+1
2018-03-05Stagenetstoffu1-2/+2
2018-02-20Merge pull request #3255Riccardo Spagni1-11/+5
3962bcb2 Closes #2886: really ignore battery checking (Timothy D. Prime)
2018-02-12Closes #2886: really ignore battery checkingTimothy D. Prime1-11/+5
Move option test first.
2018-02-02miner: restore std::cout precision after modificationmoneromooo-monero1-1/+2
Coverity 136462
2018-01-26Update 2018 copyrightxmr-eric1-1/+1
2017-12-16move includes around to lessen overall loadmoneromooo-monero1-1/+4
2017-11-11Implement missing miner functions on FreeBSDVasil Dimov1-1/+105
cryptonote::miner::get_system_times(): Fetch the system's total and idle time using sysctl kern.cp_time. cryptonote::miner::get_process_time(): Use the same implementation as Linux and OSX, the times(3) function conforms to POSIX.1 and is available on FreeBSD. cryptonote::miner::on_battery_power(): Try to fetch the battery status using sysctl hw.acpi.acline. If that fails (if ACPI is not enabled on the system), then try querying /dev/apm.
2017-11-11Remove unused variables and fix typos in commentsVasil Dimov1-4/+2
2017-10-15Merge pull request #2597Riccardo Spagni1-2/+1
c4136134 miner: always update block template when starting (moneromooo-monero)
2017-10-07miner: always update block template when startingmoneromooo-monero1-2/+1
This fixes using the previous address when starting mining, then stopping and restarting with a different address
2017-10-07Subaddresseskenshi841-1/+3
2017-09-08Fix AC power supply detection on LinuxGuillaume LE VAILLANT1-13/+0
The /sys/class/power_supply/*/present file usually does not exist for AC power supplies.
2017-08-15Merge pull request #2283Riccardo Spagni1-1/+1
d1f204d6 miner: set thread name before logging (moneromooo-monero)
2017-08-15Merge pull request #2232Riccardo Spagni1-1/+1
87b5ede9 miner: fix ignoring battery from command line (moneromooo-monero)
2017-08-12miner: set thread name before loggingmoneromooo-monero1-1/+1
2017-08-07Merge pull request #2147Riccardo Spagni1-26/+86
94717021 fix on_battery_power for linux (Ryan Mehta)
2017-07-31miner: fix ignoring battery from command linemoneromooo-monero1-1/+1
2017-07-12miner: fix background mining options parsingmoneromooo-monero1-2/+2
They were set as uint8_t, which boost was apparently treating as a character type, rather than a numeric type
2017-07-06fix on_battery_power for linuxRyan Mehta1-26/+86
fix ac/battery linux
2017-06-08Add OSX background miningjethro1-1/+37
Implements miner::get_system_times, miner::get_process_time and miner::on_battery_power for OSX so that background mining works on OSX.
2017-04-19Add expected total reward to RPC "getblocktemplate".assylias1-1/+3
Only works from V5 fork onward - returns 0 before that block.
2017-04-11Merge pull request #1946Riccardo Spagni1-0/+2
a38343bf miner: add a debug log in pause and resume (moneromooo-monero)
2017-03-31miner: add a debug log in pause and resumemoneromooo-monero1-0/+2
2017-03-28Add other possible paths of AC power status file on LinuxGuillaume LE VAILLANT1-3/+5
2017-03-25core: avoid possible reordering bugs wth tx/bloch hash cachemoneromooo-monero1-2/+2
2017-03-23core: cache tx and block hashes in the respective classesmoneromooo-monero1-0/+2
An idea from smooth
2017-02-21update copyright year, fix occasional lack of newline at line endRiccardo Spagni1-1/+1
2017-02-21Merge pull request #1733Riccardo Spagni1-4/+3
a493c0b1 BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS was odr-used, so required a definition. (Dion Ahmetaj)
2017-02-16More robust battery status handling.Dion Ahmetaj1-19/+58
Added an extra path to check for linux power supply status. Added ignore battery option. If set to true, then when we can't figure out the power status, we'll assume the system is plugged in.
2017-02-15BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS was odr-used, so ↵Dion Ahmetaj1-4/+3
required a definition. Instead of adding a declaration to cpp file, I changed it to non odr-used.
2017-02-10Added a note about smart mining to status command. Fixed up a bug where I ↵Dion Ahmetaj1-3/+3
was resetting bg mining enabled instead of started. Upped the miner threshold. Also moved setting of enabled on start above miner thread creation since starting with true, then stopping, then starting with false resulted in race condition.
2017-02-10Changed ac_line_status to on_battery_power.Dion Ahmetaj1-5/+5
2017-02-10Cleaned up some logging. Thanks to moneromooo for help.Dion Ahmetaj1-20/+20
2017-02-10Added some //TODO comments pertaining to returning enums instead of bools in ↵Dion Ahmetaj1-0/+5
order to be better able to handle failure states.
2017-02-10Moved around checking of AC power in order to bail quicker to sleep if not ↵Dion Ahmetaj1-4/+6
plugged in.
2017-02-10Moved setting of previous process times to block where background mining is ↵Dion Ahmetaj1-14/+11
started, and added an explicit sleep in that block to wait for some mining to occur.
2017-02-10Set background mining started bool to false on bg thread start. If ↵Dion Ahmetaj1-0/+1
mining::stop then mining::start, idle logic is re-run instead of starting immediately (if it was running before stop).
2017-02-10Background/smart mining. If a users' computer is plugged into a powerDion Ahmetaj1-6/+394
source, and CPU has been idle for some time, then begin mining to some threshold (don't destroy the users' CPU). This patch only supports windows and linux (I've only tested on Win64 and Ubuntu). The variables currently default to pretty conservative values (i.e. 20% CPU mining threshold).
2017-02-08extract some basic code from libcryptonote_core into libcryptonote_basickenshi841-0/+414