1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-12 07:48:22 +00:00
Commit Graph

981 Commits

Author SHA1 Message Date
ckolivas
e746ed6412 Make the initialisation of the stratum thread more robust allowing the watchpool thread safe access to it after the stratum thread is started. 2013-03-08 15:18:10 +11:00
Con Kolivas
d7c4be30ba Only set stratum auth once to prevent multiple threads being started. 2013-03-07 21:41:01 +11:00
Con Kolivas
3db4d6f0eb Display select return value on select fail in stratum thread. 2013-03-07 21:07:15 +11:00
Con Kolivas
a8863995de Rollback breakage to 81567e5157 2013-03-07 19:00:47 +11:00
Con Kolivas
a5d35e822a Only bypass unusable pools if they're not the selected ones. 2013-03-07 18:44:40 +11:00
Con Kolivas
1468feb0d3 Find the first usable pool in preference to the current pool in select_pool for work. 2013-03-07 18:13:25 +11:00
Con Kolivas
ade8c6c79c Add a pool_unusable function which checks if a pool is stratum but not active to use within switch_pools. 2013-03-07 18:00:15 +11:00
Con Kolivas
81567e5157 Perform pool resus on pools that were not set as the initial pool at startup. 2013-03-07 17:00:23 +11:00
Con Kolivas
c7c21e6c37 Revert "Clear the pool idle flag only on the pool chosen at startup, allowing it to be cleared by the watchpool thread for the other pools."
This reverts commit 370e8fc862.
2013-03-07 16:56:03 +11:00
Con Kolivas
370e8fc862 Clear the pool idle flag only on the pool chosen at startup, allowing it to be cleared by the watchpool thread for the other pools. 2013-03-07 16:49:16 +11:00
Con Kolivas
e501db143d Allow pools to be resuscitated on first startup by the watchpool thread. 2013-03-07 16:45:25 +11:00
Con Kolivas
5221662557 Check all pools simultaneously at startup switching to the first alive one to speed up startup. 2013-03-07 16:39:49 +11:00
Con Kolivas
12553004c5 Do not continue work from a stratum pool where the connection has been interrupted. 2013-03-07 14:40:48 +11:00
Con Kolivas
bba99bd88c Show mechanism of stratum interruption if select times out. 2013-03-07 13:39:00 +11:00
Con Kolivas
011ea64096 Make stratum connection interrupted message higher priority to be visible at normal logging levels. 2013-03-07 12:42:44 +11:00
Con Kolivas
96ae17a466 Merge pull request #398 from kanoi/bflsc
API use control_lock when switching pools + Setup BFLSC support + API add 'Network Difficulty' to 'coin'
2013-03-06 15:51:33 -08:00
Kano
0eafc8b9fe API add 'Network Difficulty' to 'coin' 2013-03-07 07:40:05 +11:00
Kano
540f3e89bc Setup BFLSC support 2013-03-07 00:00:31 +11:00
ckolivas
386ea2dffb Instead of keeping track of when the last work item was generated to keep stratum connections open, keep them open if any shares have been submitted awaiting a response. 2013-03-06 14:34:17 +11:00
Con Kolivas
82fce46633 Merge pull request #395 from kanoi/bflsc
configure - set USE_USBUTILS when usbutils is required and use it in the code
2013-03-05 02:47:19 -08:00
Kano
2f6660e83f configure - set USE_USBUTILS when usbutils is required and use it in the code 2013-03-05 18:33:43 +11:00
Con Kolivas
016f065f69 Clear last pool work on switching pools if the current pool supports local work generation or we are in failover only mode. 2013-03-05 11:16:20 +11:00
Kano
120e9a072d make rw locks: mining_thr_lock and devices_lock 2013-03-04 22:46:34 +11:00
Kano
be8cadbc46 Hotplug - allow setting interval via --hotplug or API 2013-03-04 17:26:11 +11:00
Kano
97cb77d18a curses - fix - put a dev_width inside #ifdef 2013-03-04 14:06:15 +11:00
Kano
e35e8ae135 Implement and use usb_cleanup() on shutdown or restart 2013-03-04 09:45:07 +11:00
Kano
c14f2ec642 API V1.25 - add 'Last Valid Work' time for each device 2013-03-03 19:33:20 +11:00
Kano
cc3869e5ce api -> drv 2013-03-03 16:38:02 +11:00
Con Kolivas
357294a70e Merge branch 'usb-dev' 2013-03-02 17:22:42 +11:00
Con Kolivas
2c3a946cf9 Update a pool's last work time when the work is popped as well as staged. 2013-03-02 16:01:37 +11:00
Con Kolivas
5c32a47b96 Merge pull request #375 from luke-jr/bugfix_cfgwrite_fnleak
Free filename entry for writing config file when done with it
2013-03-01 14:29:20 -08:00
Con Kolivas
52995e2811 Merge pull request #389 from kanoi/bflsc
BFL stop 1st init command if no device + Update diff stale: total and pools when stratum throws away shares
2013-03-01 14:28:02 -08:00
Kano
42a01e7b37 Update diff stale: total and pools when stratum throws away shares 2013-03-01 16:49:08 +11:00
Con Kolivas
b2b0d10a00 Merge branch 'master' into usb-dev 2013-02-28 23:37:06 +11:00
Con Kolivas
b4cac54a7e Keep stratum connections open for 2 minutes after the last work item was staged to allow stray shares to be submitted on pool switching. 2013-02-28 23:35:31 +11:00
Con Kolivas
5abcf06bbe Merge branch 'master' into usb-dev 2013-02-25 10:44:54 +11:00
Con Kolivas
d9d5a1a0b6 Speed up watchdog interval and therefore display updates to 2 seconds. 2013-02-25 10:43:47 +11:00
Con Kolivas
5a3b374962 Update copyright dates. 2013-02-25 08:59:11 +11:00
Con Kolivas
6bf79626b8 Merge branch 'master' into usb-dev 2013-02-23 13:59:37 +11:00
Con Kolivas
d16d4928f7 Fix --benchmark generating valid work for cgminer. 2013-02-22 21:41:47 +11:00
ckolivas
6a0882f05b Use the sessionid as passed on stratum connect to attempt to resume a connection once and then clear it if it fails, to use a new connection. 2013-02-22 16:55:39 +11:00
ckolivas
68d691093c Move to storing the nonce1 in the work struct instead of the sessionid for the now defunct first draft mining.resume protocol. 2013-02-22 12:55:01 +11:00
Con Kolivas
fce5434975 Add a get_queued function for devices to use to retrieve work items from the queued hashtable. 2013-02-18 14:14:10 +11:00
ckolivas
f910476daa Merge branch 'usb-dev' into queued_work 2013-02-17 00:10:59 +11:00
ckolivas
22a50a5a0f Merge branch 'usb-dev' of github.com:ckolivas/cgminer into usb-dev 2013-02-17 00:10:36 +11:00
Con Kolivas
4fdd45af6b Merge pull request #387 from luke-jr/bugfix_20130215b
Bugfix: Duplicate stratum sessionid when copying work, to avoid double-free
2013-02-16 03:51:33 -08:00
Luke Dashjr
0847d45867 Bugfix: Duplicate stratum sessionid when copying work, to avoid double-free 2013-02-16 06:46:00 +00:00
Con Kolivas
fda6d46e95 Add the choice of hash loop to the device driver, defaulting to hash_sole_work if none is specified. 2013-02-16 14:09:44 +11:00
Con Kolivas
254e25ac7f Add comments. 2013-02-16 14:03:40 +11:00
Con Kolivas
c80c65eac0 Add a driver specific flush_work for queued devices that may have work items already queued to abort working on them on the device and discard them. 2013-02-16 12:38:53 +11:00
Con Kolivas
294cda2eb2 Flush queued work on a restart from the hash database and discard the work structs. 2013-02-16 12:35:16 +11:00
Con Kolivas
e8e88beff1 Create a central point for removal of work items completed by queued device drivers. 2013-02-16 12:28:50 +11:00
Con Kolivas
95b2020263 Create a fill_queue function that creates hashtables of as many work items as is required by the device driver till it flags the queue full. 2013-02-16 12:14:13 +11:00
Con Kolivas
5e3253a7cf Create the hash queued work variant for use with devices that are fast enough to require a queue. 2013-02-16 11:54:05 +11:00
Con Kolivas
649f2939f7 Update copyright year. 2013-02-16 09:09:44 +11:00
Con Kolivas
0b83313161 Fix tv_lastupdate being made into tv_end and update the hashmeter on cycle, not opt_log_interval. 2013-02-16 09:08:19 +11:00
Con Kolivas
e414cd055c Fix tv_lastupdate being made into tv_end and update the hashmeter on cycle, not opt_log_interval. 2013-02-16 09:07:33 +11:00
Con Kolivas
ab0cc58cb4 Merge branch 'master' into usb-dev 2013-02-15 23:15:11 +11:00
Con Kolivas
0f7ab3670c Only continue submitting shares with mining.resume support on stratum when the session id matches. 2013-02-15 23:11:13 +11:00
Con Kolivas
be4705a003 Provide support for mining.resume with stratum, currently re-authorising after successful resumption pending finalising of the protocol process. 2013-02-15 23:05:29 +11:00
Con Kolivas
4cde791e9f Provide basic framework for restarting stratum depending on whether resume support exists or not. 2013-02-15 21:31:44 +11:00
Con Kolivas
16c7c983ae Free sessionid in clean_work and remove redundant setting of strings to NULL since the whole work struct is zeroed. 2013-02-15 20:27:07 +11:00
Con Kolivas
8fdf6d5c64 Only clear stratum shares mandatorily on stratum dropouts when the pool does not support resume. 2013-02-15 18:34:54 +11:00
Con Kolivas
f60637c3f9 Try resubmitting stratum shares every 5 seconds for up to 2 minutes if the pool session id exists and matches on failure to submit. 2013-02-15 17:48:13 +11:00
Con Kolivas
7e8019acdd Do as much outside of mutex locking of sshare_lock as possible. 2013-02-15 16:13:24 +11:00
Con Kolivas
7551b88d00 Remove last reference to struct work used outside the sshare_lock in submit_work_thread 2013-02-15 16:09:36 +11:00
Con Kolivas
ebb99e5a8d Unlock the sshare_lock in submit_work_thread when all references to work and sshare are complete. 2013-02-15 16:05:21 +11:00
Con Kolivas
1bf1f4a217 Add timestamps to stratum_share structs as they're generated and copy the stratum sessionid if it exists to stratum work generated. 2013-02-15 15:36:29 +11:00
Con Kolivas
20b5ebbc95 hash_sole_work can be static 2013-02-11 15:28:41 +11:00
Con Kolivas
c28e2238c6 Merge branch 'master' into usb-dev 2013-02-10 13:29:25 +11:00
Con Kolivas
775a1abc06 Keep the unique id of each work item across copy_work to prevent multiple work items having the same id. 2013-02-10 13:28:06 +11:00
Con Kolivas
61a3e1b1d1 Merge pull request #382 from kanoi/hotplug
USB tidy up requests + Hotplug
2013-02-09 02:36:27 -08:00
Con Kolivas
dafc2f775a Abstract out the main hashing loop to allow us to use a separate loop for devices that are fast enough to require queued work. 2013-02-09 21:12:03 +11:00
Con Kolivas
81b84d4f7b Provide a noop thread_enable function for drivers that don't support it. 2013-02-09 19:59:36 +11:00
Con Kolivas
b884d11a23 Provide a noop thread_shutdown function for drivers that don't support it. 2013-02-09 19:56:45 +11:00
Con Kolivas
2c28eefc45 Provide a noop hw_error function for drivers that don't support it. 2013-02-09 19:54:54 +11:00
Con Kolivas
210537198c Provide a noop prepare_work for drivers that don't support it. 2013-02-09 19:52:00 +11:00
Con Kolivas
b9f5b48c08 Provide a noop thread_init for drivers that don't support it. 2013-02-09 19:50:07 +11:00
Con Kolivas
8e12a05b47 Provide a noop can_limit_work for devices that don't support it. 2013-02-09 19:48:11 +11:00
Con Kolivas
5b22f092d9 Provide a noop thread_prepare function for drivers that don't use thread_prepare. 2013-02-09 19:36:38 +11:00
Con Kolivas
5d581cb5d7 Use blank_get_statline_before for GPU devices that don't support adl monitoring. 2013-02-09 19:27:57 +11:00
Con Kolivas
2c3c9e5b55 Provide a noop get_stats function for drivers that don't support it. 2013-02-09 19:25:24 +11:00
Con Kolivas
de48ccca0e Provide a blank get_statline for drivers that don't support it. 2013-02-09 19:22:13 +11:00
Con Kolivas
b3d9477eb7 Provide a blank get_statline_before function for drivers that don't have one. 2013-02-09 18:18:52 +11:00
Con Kolivas
f2380eab4c Fill drivers missing reinit_device with a noop version. 2013-02-09 15:10:10 +11:00
Kano
530e3b0172 hotplug use get_thread() where appropriate 2013-02-08 02:38:37 +11:00
Kano
6fb32f7b5d convert sleep(const) to nmsleep() 2013-02-08 02:32:27 +11:00
Kano
bc5755233c call a separate get_devices() with locking, as required 2013-02-08 02:12:09 +11:00
Kano
983fe2b0c0 usbutils hotplug v0.1 2013-02-08 01:42:36 +11:00
Kano
296eab26b4 Report USB nodev as ZOMBIE on the screen 2013-02-08 01:34:48 +11:00
Con Kolivas
3c91b292a2 Merge branch 'master' into usb-dev 2013-02-07 18:02:38 +11:00
Con Kolivas
3804850141 Do not consider every call to stratum_resumed a pool recovery unless it was actually idle. 2013-02-07 13:51:54 +11:00
Con Kolivas
03dff61e54 Merge branch 'master' into usb-dev 2013-02-05 22:00:23 +11:00
Con Kolivas
73b7d7b0c9 Do not enable the pool disable on reject feature unless explicitly enabled with --disable-rejecting. 2013-02-05 21:47:26 +11:00
Con Kolivas
5c1f3b36d6 Merge branch 'master' into usb-dev 2013-02-05 21:34:58 +11:00
Kano
f52f02e9b7 Stratum disconnect shares - count total against stale 2013-02-05 21:34:39 +11:00
Con Kolivas
ffdcaed49d Use sanity checking to prevent a possible overflow with invalid data being given by the pool for difficulty as reported by luke-Jr. 2013-02-05 21:10:18 +11:00
Con Kolivas
0244998ef8 Merge branch 'master' into usb-dev 2013-02-04 11:23:20 +11:00
Con Kolivas
81025611ac Check for calloc failure for completeness in gen_stratum_work. 2013-02-04 11:22:08 +11:00
Con Kolivas
d644fdf1f4 Cache the coinbase length to speed up stratum work generation. 2013-02-04 11:19:12 +11:00