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

10
util.c

@ -2095,8 +2095,11 @@ static bool setup_stratum_socket(struct pool *pool) @@ -2095,8 +2095,11 @@ static bool setup_stratum_socket(struct pool *pool)
mutex_lock(&pool->stratum_lock);
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);
}
pool->sock = 0;
mutex_unlock(&pool->stratum_lock);
@ -2119,9 +2122,10 @@ static bool setup_stratum_socket(struct pool *pool) @@ -2119,9 +2122,10 @@ static bool setup_stratum_socket(struct pool *pool)
sockaddr_url = pool->sockaddr_url;
sockaddr_port = pool->stratum_port;
}
if (getaddrinfo(sockaddr_url, sockaddr_port, hints, &servinfo) != 0) {
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);
pool->probed = true;
} else {
@ -2278,6 +2282,8 @@ bool initiate_stratum(struct pool *pool) @@ -2278,6 +2282,8 @@ bool initiate_stratum(struct pool *pool)
resend:
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;
goto out;
}

Loading…
Cancel
Save