1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-09 06:18:06 +00:00
Commit Graph

473 Commits

Author SHA1 Message Date
ystarnaud
4ba8a68043 Merged develop branch with master +updates
Moved the develop code to master. Moving forward all updates will be
done on master unless it's work on a major feature.

This update contains all previous develop code as well as a few new ones
that weren't pushed yet:

* Added neoscrypt compatibility for xintensity/rawintensity
* Neoscrypt now uses correct TC if not specified or set to 0
* Reworked the application of pool settings on algorithm switch which
should resolve TC/Intensity changes between algos such as X11 and
neoscrypt
2014-12-03 10:09:55 -05:00
Jan Berdajs
0bd7a9ff63 After cancelling a thread (unless it's detached, but mining threads aren't), it is always necessary to join the thread so the system will release resources.
This also simplifies kill_mining a bit.
2014-07-07 12:35:27 +02:00
Elbandi
a39316dbd3 Fix nonce1 and sessionid memory leak 2014-07-03 17:24:34 +02:00
ystarnaud
9d54637e3c Fix HW Issue at startup
Fixed an issue where the GPUs would be initialized on first pool alive,
but the mining threads would end up being initialized on another pool
because it was selected right away.
2014-06-30 00:12:12 -04:00
Jan Berdajs
25d7d426fd convert tabs to spaces in most commonly modified files 2014-06-09 17:45:06 +02:00
Jan Berdajs
ff05aacdc3 attempt to fix memory issues when doing curl calls
From curl CURLOPT_ERRORBUFFER docs: You must keep the associated storage available until libcurl no longer needs it. Failing to do so will cause very odd behavior or even crashes. libcurl will need it until you call curl_easy_cleanup(3) or you set the same option again to use a different pointer.
2014-06-09 01:17:29 +02:00
Jan Berdajs
5e3142cf68 remove unused code (mostly intended for ASICs which are not supported in sgminer), fix some compiler warnings 2014-06-08 20:36:33 +02:00
Noel Maersk
910c360899 stratum: parse_notify(): Don't die on malformed bbversion/prev_hash/nbit/ntime.
Might have introduced a memory leak, don't have time to check. :(

Should the other hex2bin()'s be checked?

Thanks to Mick Ayzenberg <mick.dejavusecurity.com> for finding this.
2014-06-05 23:07:47 +03:00
Noel Maersk
78cc408369 stratum: parse_reconnect(): treat pool-sent URL as untrusted.
Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for reminding
that this existed and highlighting the offender.

Also to Luke-jr for actually fixing this in bfgminer. :D
2014-06-05 23:07:08 +03:00
Luke Dashjr
b65574bef2 Stratum: extract_sockaddr: Truncate overlong addresses rather than stack overflow
Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for finding this!
2014-06-05 21:29:44 +03:00
Luke Dashjr
bac5831b35 Bugfix: initiate_stratum: Ensure extranonce2 size is not negative (which could lead to exploits later as too little memory gets allocated)
Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for finding this!
2014-06-05 21:20:25 +03:00
Jan Berdajs
e4a4efdb42 fix some potential memory leaks, remove a few old unused functions 2014-06-05 00:13:43 +02:00
Jan Berdajs
6c5ce535d9 fix compiler warnings 2014-05-29 01:34:29 +02:00
elbandi
91a26c46b7 Protect pool name with lock
Disconnect from pool, if auth is failed

handle mining.set_extranonce method

subscribe for mining.extranonce

Allow disable extranonce subscribe

Send subscribe request before auth

Change mining.set_extranonce method as stratum notification

Set extranonce.subscribe timeout to 2sec

Some tweaks for extranonce

Handle pool response, who send errors in invalid format

Move no-extranonce-subscribe parameter to a pool config

Include pool.h

Set the pool idle and switch pool, if need

Mark pool as idle if stratum restart is failed

Conflicts:
	sgminer.c
2014-05-28 23:17:51 +02:00
Jan Berdajs
c0baf790f6 making new algorithms and other changes merged from sph-sgminer work with current version of sgminer 2014-05-27 01:11:54 +02:00
Jan Berdajs
93e3a6d107 Merge branch 'master' into sph
Not working yet, need to upgrade algorithm_t

Conflicts:
	configure.ac
	driver-opencl.c
	miner.h
	ocl.c
	sgminer.c
	util.c
2014-05-24 21:22:04 +02:00
elbandi
98676763b9 Set the pool idle and switch pool, if need 2014-05-08 00:02:39 +02:00
elbandi
c469ff923a Disconnect from pool, if auth is failed 2014-05-08 00:02:03 +02:00
Elbandi
973dcefa8c Use get_pool_name everywhere 2014-04-24 12:09:56 +02:00
Noel Maersk
7051629232 log: change log level in setup_stratum_socket().
Erroneously stayed at LOG_ERROR after issue #88 (IIRC).
2014-04-07 23:54:43 +03:00
phm
7678db6801 Fixed problem with stratum support when mining FC, GRS and TWE. Added --difficulty-multiplier parameter for controlling stratum difficulty multiplier. 2014-04-05 20:55:22 +02:00
Noel Maersk
cabb02f5d4 log: do not show pool difficulty changes on non-current pool.
Keep log spam down when using a lot of vardiff pools, or if a p2pool is
a fallback.
2014-04-02 23:35:03 +03:00
Noel Maersk
1f7b7ef26e stratum: move log warning under opt_disable_client_reconnect clause. 2014-03-24 15:25:31 +02:00
Martin Danielsen
01b3f70b63 A new --no-client-reconnect command that disables the 'client.reconnect' function.
It looks like there's an exploit that abuses said command, but it is still not clear exactly how.

There's also an additional message when the reconnect happens: "WARNING: POTENTIAL CLIENT.EXPLOIT!", but it requires you to be actively monitoring your log to catch it, and in which case you already get a "Reconnect requested from Pool 0 to 127.0.0.1" message.

Note that disabling 'client.reconnect' might affect some pools that rely on the feature, like pools that you lease your rig to.

Oh and this is dry-coded. :)
2014-03-24 15:12:40 +02:00
phm
21d928b543 Fixed problem with invalid stratum difficulty for Quark, AnimeCoin and QubitCoin. 2014-03-22 14:16:49 +01:00
troky
49aef7100f Reverting "poolname" to "name". 2014-03-15 19:08:24 +02:00
Noel Maersk
8f014effeb util: add missing include. 2014-03-02 19:15:30 +02:00
Noel Maersk
d58de45c0e pool: use get_pool_name() where appropriate. 2014-02-28 23:22:40 +02:00
Noel Maersk
44aed3570e Merge branch 'build-msvs2010-upd' into build-msvs2010-merge
Test in separate branch before merging into master.

Conflicts (resolved):
	api.c
	util.c
2014-02-22 17:05:07 +02:00
phm
9585d2a8e6 Added support for DarkCoin kernel. Modified stats display to handle low difficulty values. 2014-02-19 23:06:29 +01:00
Con Kolivas
aca8a58f2e Only show one decimal place if pool diff is not an integer. 2014-02-16 15:11:59 +02:00
Con Kolivas
f7394ff165 Check for more interrupted conditions in util.c and handle them gracefully. 2014-02-16 14:43:00 +02:00
Con Kolivas
6b246a59f3 Handle interruptions to various select calls in util.c 2014-02-16 14:41:58 +02:00
Con Kolivas
cc2aa215a8 Clear pool work on a stratum reconnect message. 2014-02-16 13:57:20 +02:00
Kano
faf63ec036 Modify thread naming to make them easier to identify 2014-02-16 13:56:14 +02:00
Con Kolivas
003b65b7b1 Change stratum strings under stratum_lock in reconnect and free old strings.
Conflicts resolved:
	util.c
2014-02-16 13:38:51 +02:00
Noel Maersk
91d36d097a log: add LOG_DEBUG message on restarting stratum. 2014-02-14 20:51:16 +02:00
Noel Maersk
ed586c4aa5 misc: indentation. 2014-02-14 20:33:38 +02:00
Noel Maersk
abeeff3d45 log: print getaddrinfo() error description.
More debugging for issue 88.
2014-02-14 19:59:59 +02:00
Noel Maersk
a8dfb3ebef pool: add getaddrinfo() LOG_DEBUG messages.
More for issue 88.
2014-02-13 13:40:47 +02:00
Noel Maersk
115eb1ad2f pool: be verbose on which pool failed. 2014-02-13 12:29:35 +02:00
Noel Maersk
87102ecd07 pool: additional debug logging for stratum pools.
Might help in trying to resove issue 88.
2014-02-12 21:11:59 +02:00
Markus Peloquin
bf8e37ce19 Support building in cygwin.
Revised the compiler platform macros. Building goes like
$ AMDAPPSDKROOT= CPPFLAGS=-I/usr/include/ncurses ./configure
2014-02-07 22:31:40 -08:00
Sanjin Trošelj
87e5f35745 VS2010 build: commit elist.h and relevant changes in sgminer.c and util.c
Cherry-picked by veox.

Introduces a segfault. Expect a HEAD reset.
2014-01-28 02:42:56 +02:00
Sanjin Trošelj
5078db8b01 VS2010 build: Prepare util.c
Cherry-picked by veox.
2014-01-28 01:04:04 +02:00
Martin Danielsen
d7e469bd76 Stratum servers can now be named.
The names will be used throughout the display in the program, when not set "Pool 1" will
simply be used instead. The names are not exposed through API yet, it's on my TODO list.

Use "poolname" like this:

	{
		"poolname" : "Example pool",
		"url" : "stratum+tcp://example.com:8080",
		"user" : "y",
		"pass" : "x"
	},

Conflicts:
	sgminer.c
	util.c
2014-01-18 21:05:26 +02:00
Noel Maersk
50066cf3c7 misc: Replace all remaining instances of 'cgminer' with 'sgminer'.
sed again.
2014-01-15 16:36:48 +02:00
Con Kolivas
9628207066 Provide a helper function that can reset cgsems to zero. 2014-01-15 14:28:24 +02:00
Con Kolivas
7d2cee3066 Drop json stratum auth failed message log level to verbose. 2014-01-15 13:35:19 +02:00
Maksym Borodin
8fa5ddfd2c util.c: Decreasing reference count on allocated JSON obects to prevent memory leak 2014-01-14 18:35:56 +02:00