Post
Topic
Board Service Announcements
Re: [ANN] NiceHash.com - innovative professional cryptocurrency cloud mining service
by
phzi
on 25/04/2014, 15:19:37 UTC
My 'idle miner' patch that has been effective on my rigs is a single line change:

in util.c, auth_stratum function

Either immediately before or immediately after the 'JSON stratum auth failed' applog, add one line:
Code:
pool->idle = true;

This correctly marks the pool as 'Dead,' after a failed stratum auth, and the next alive pool will be chosen.  Because the pool is marked idle, a reconnect attempt will be made periodically. If auth is succesful, the pool is marked 'Alive,' and mining resumes.

Without this 1 liner, the pool is still seen as alive after a failed auth. So, sgminer sits and waits for work even tho the connection was not successful. (Truthfully, the connection and auth are seperate ideas in the stratum protocol, so you can connect but fail auth, in which case you did 'connect' successfully).

Note, of course, I offer this 1 line of code with no warranty whatsoever. You have been warned! ;-]