From 0be6e9e76cf300381c31fa488bda0250d99db517 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 6 Mar 2013 21:00:16 +1100 Subject: [PATCH] Make sure to retry only once with noresume support for stratum. --- util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util.c b/util.c index 056984e1..4abae22d 100644 --- a/util.c +++ b/util.c @@ -1481,8 +1481,8 @@ out: bool initiate_stratum(struct pool *pool) { char s[RBUFSIZE], *sret = NULL, *nonce1, *sessionid; + bool ret = false, recvd = false, noresume = false; json_t *val = NULL, *res_val, *err_val; - bool ret = false, recvd = false; json_error_t err; int n2size; @@ -1582,7 +1582,7 @@ out: pool->pool_no, pool->nonce1, pool->n2size); } } else { - if (recvd) { + if (recvd && !noresume) { /* Reset the sessionid used for stratum resuming in case the pool * does not support it, or does not know how to respond to the * presence of the sessionid parameter. */ @@ -1592,6 +1592,7 @@ out: pool->sessionid = pool->nonce1 = NULL; mutex_unlock(&pool->pool_lock); applog(LOG_DEBUG, "Failed to resume stratum, trying afresh"); + noresume = true; goto resend; } applog(LOG_DEBUG, "Initiate stratum failed");