Commit Graph

14 Commits

Author SHA1 Message Date
moneromooo-monero
f065234b71
core: cache tx and block hashes in the respective classes
An idea from smooth
2017-03-23 09:25:17 +00:00
Riccardo Spagni
c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
Riccardo Spagni
6994c85201
Merge pull request #1733
a493c0b1 BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS was odr-used, so required a definition. (Dion Ahmetaj)
2017-02-21 11:21:14 +02:00
Dion Ahmetaj
69ab14d91e More robust battery status handling.
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-16 14:35:01 -05:00
Dion Ahmetaj
a493c0b196 BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS was odr-used, so required a definition.
Instead of adding a declaration to cpp file, I changed it to non odr-used.
2017-02-15 11:15:12 -05:00
Dion Ahmetaj
ad95e65028 Added a note about smart mining to status command. Fixed up a bug where I 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-10 18:07:43 -05:00
Dion Ahmetaj
e4dfd2fb63 Changed ac_line_status to on_battery_power. 2017-02-10 18:07:42 -05:00
Dion Ahmetaj
d2c7d0f6b0 Cleaned up some logging. Thanks to moneromooo for help. 2017-02-10 18:07:41 -05:00
Dion Ahmetaj
68652cd94d Added some //TODO comments pertaining to returning enums instead of bools in order to be better able to handle failure states. 2017-02-10 18:07:41 -05:00
Dion Ahmetaj
0b1045ed7d Moved around checking of AC power in order to bail quicker to sleep if not plugged in. 2017-02-10 18:07:40 -05:00
Dion Ahmetaj
2937fdbbbf Moved setting of previous process times to block where background mining is started, and added an explicit sleep in that block to wait for some mining to occur. 2017-02-10 18:07:40 -05:00
Dion Ahmetaj
21a1e0252f Set background mining started bool to false on bg thread start. If mining::stop then mining::start, idle logic is re-run instead of starting immediately (if it was running before stop). 2017-02-10 18:07:39 -05:00
Dion Ahmetaj
345ed4823c Background/smart mining. If a users' computer is plugged into a power
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-10 18:07:39 -05:00
kenshi84
8027ce0c75 extract some basic code from libcryptonote_core into libcryptonote_basic 2017-02-08 22:45:15 +09:00