mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Clear the socket of anything in the receive buffer if we're going to retry connecting.
This commit is contained in:
parent
a8863995de
commit
501f4cd6ec
9
util.c
9
util.c
@ -1525,13 +1525,16 @@ bool initiate_stratum(struct pool *pool)
|
||||
|
||||
sockd = true;
|
||||
resend:
|
||||
if (!recvd) {
|
||||
if (recvd) {
|
||||
/* Get rid of any crap lying around if we're resending */
|
||||
clear_sock(pool);
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
|
||||
} else {
|
||||
if (pool->sessionid)
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"VERSION"\", \"%s\"]}", swork_id++, pool->sessionid);
|
||||
else
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": [\""PACKAGE"/"VERSION"\"]}", swork_id++);
|
||||
} else
|
||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
|
||||
}
|
||||
|
||||
if (!__stratum_send(pool, s, strlen(s))) {
|
||||
applog(LOG_DEBUG, "Failed to send s in initiate_stratum");
|
||||
|
Loading…
Reference in New Issue
Block a user