aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.cpp (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
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-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-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-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-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-05Correct spelling mistakes.Edward Betts1-1/+1
2018-03-05Stagenetstoffu1-2/+2
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-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-12miner: set thread name before loggingmoneromooo-monero1-1/+1
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-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-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/+0
2017-01-22Remove boost/foreach.cpp includesMiguel Herranz1-1/+0
2017-01-22Replace BOOST_FOREACH with C++11 ranged forMiguel Herranz1-1/+1
2017-01-16Change logging to easylogging++moneromooo-monero1-11/+14
This replaces the epee and data_loggers logging systems with a single one, and also adds filename:line and explicit severity levels. Categories may be defined, and logging severity set by category (or set of categories). epee style 0-4 log level maps to a sensible severity configuration. Log files now also rotate when reaching 100 MB. To select which logs to output, use the MONERO_LOGS environment variable, with a comma separated list of categories (globs are supported), with their requested severity level after a colon. If a log matches more than one such setting, the last one in the configuration string applies. A few examples: This one is (mostly) silent, only outputting fatal errors: MONERO_LOGS=*:FATAL This one is very verbose: MONERO_LOGS=*:TRACE This one is totally silent (logwise): MONERO_LOGS="" This one outputs all errors and warnings, except for the "verify" category, which prints just fatal errors (the verify category is used for logs about incoming transactions and blocks, and it is expected that some/many will fail to verify, hence we don't want the spam): MONERO_LOGS=*:WARNING,verify:FATAL Log levels are, in decreasing order of priority: FATAL, ERROR, WARNING, INFO, DEBUG, TRACE Subcategories may be added using prefixes and globs. This example will output net.p2p logs at the TRACE level, but all other net* logs only at INFO: MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE Logs which are intended for the user (which Monero was using a lot through epee, but really isn't a nice way to go things) should use the "global" category. There are a few helper macros for using this category, eg: MGINFO("this shows up by default") or MGINFO_RED("this is red"), to try to keep a similar look and feel for now. Existing epee log macros still exist, and map to the new log levels, but since they're used as a "user facing" UI element as much as a logging system, they often don't map well to log severities (ie, a log level 0 log may be an error, or may be something we want the user to see, such as an important info). In those cases, I tried to use the new macros. In other cases, I left the existing macros in. When modifying logs, it is probably best to switch to the new macros with explicit levels. The --log-level options and set_log commands now also accept category settings, in addition to the epee style log levels.
2016-10-04Brackets to ensure doesn't function prematurely returnNanoAkron1-0/+2
2016-10-03Moved logging to target functions rather than callerNanoAkron1-0/+3
2016-09-18miner: do not try to save config if the path isn't setmoneromooo-monero1-1/+2
This saves on an exception dump when trying to write to / after finding a block.
2016-03-21Revert "Print stack trace upon exceptions"moneromooo-monero1-1/+0
Ain't nobody got time for link/cmake skullduggery. This reverts commit fff238ec94ac6d45fc18c315d7bc590ddfaad63d.
2016-03-19Print stack trace upon exceptionsmoneromooo-monero1-0/+1
Useful for debugging users' logs
2015-12-31updated copyright yearRiccardo Spagni1-1/+1
2015-12-30miner: minor fixes on stopmoneromooo-monero1-1/+4
- only try to stop if actually started - print number of threads before zeroing it This fixes the suspiciously doubled "Mining has been stopped" message on exit.
2015-12-19Add missing semicolons after log statementsmoneromooo-monero1-1/+1
2015-12-15Replace tabs with two spaces for consistency with rest of codebasewarptangent1-15/+14
Remove trailing whitespace in same files.
2015-01-02year updated in licenseRiccardo Spagni1-1/+1
2014-09-15Separate testnet address prefixZachary Michaels1-2/+2
2014-07-23License updated to BSD 3-clausefluffypony1-4/+29
2014-06-16Update miner.cppNoodleDoodleNoodleDoodleNoodleDoodleNoo1-1/+4
1. Added support for scratchpad memory allocation.
2014-06-16Revert "Update miner.cpp"NoodleDoodleNoodleDoodleNoodleDoodleNoo1-19/+5
This reverts commit c0520ad63d71f94bc78a119c61ade30876e95ed6.
2014-06-16Update miner.cppNoodleDoodleNoodleDoodleNoodleDoodleNoo1-5/+19
1. Added scratchpad memory allocation support.
2014-05-25'mining_status' Daemon RPC commandNeozaru1-4/+15
2014-04-30mac osx building fixesmydesktop1-3/+8
2014-04-07Improvements in JSON RPCAntonio Juarez1-2/+6
2014-03-03moved all stuff to githubAntonio Juarez1-0/+356