Browse Source

pool: additional debug logging for stratum pools.

Might help in trying to resove issue 88.
nfactor-troky
Noel Maersk 11 years ago
parent
commit
87102ecd07
  1. 1
      sgminer.c
  2. 10
      util.c

1
sgminer.c

@ -5596,6 +5596,7 @@ retry_stratum:
goto retry_stratum; goto retry_stratum;
} }
/* json_rpc_call() above succeeded */
if (val) { if (val) {
struct work *work = make_work(); struct work *work = make_work();
bool rc; bool rc;

10
util.c

@ -2095,8 +2095,11 @@ static bool setup_stratum_socket(struct pool *pool)
mutex_lock(&pool->stratum_lock); mutex_lock(&pool->stratum_lock);
pool->stratum_active = false; pool->stratum_active = false;
if (pool->sock) if (pool->sock) {
/* FIXME: change to LOG_DEBUG if issue #88 resolved */
applog(LOG_INFO, "Closing %s socket", pool->poolname);
CLOSESOCKET(pool->sock); CLOSESOCKET(pool->sock);
}
pool->sock = 0; pool->sock = 0;
mutex_unlock(&pool->stratum_lock); mutex_unlock(&pool->stratum_lock);
@ -2119,9 +2122,10 @@ static bool setup_stratum_socket(struct pool *pool)
sockaddr_url = pool->sockaddr_url; sockaddr_url = pool->sockaddr_url;
sockaddr_port = pool->stratum_port; sockaddr_port = pool->stratum_port;
} }
if (getaddrinfo(sockaddr_url, sockaddr_port, hints, &servinfo) != 0) { if (getaddrinfo(sockaddr_url, sockaddr_port, hints, &servinfo) != 0) {
if (!pool->probed) { if (!pool->probed) {
applog(LOG_WARNING, "Failed to resolve (?wrong URL) %s:%s", applog(LOG_WARNING, "Failed to resolve (wrong URL?) %s:%s",
sockaddr_url, sockaddr_port); sockaddr_url, sockaddr_port);
pool->probed = true; pool->probed = true;
} else { } else {
@ -2278,6 +2282,8 @@ bool initiate_stratum(struct pool *pool)
resend: resend:
if (!setup_stratum_socket(pool)) { if (!setup_stratum_socket(pool)) {
/* FIXME: change to LOG_DEBUG when issue #88 resolved */
applog(LOG_INFO, "setup_stratum_socket() on %s failed", pool->poolname);
sockd = false; sockd = false;
goto out; goto out;
} }

Loading…
Cancel
Save