From fd45d582d4570d3f5f0398b4c1a05a2e8acf1943 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 2 Aug 2014 13:05:52 +1000 Subject: [PATCH] Add messages for when each process is ready --- src/connector.c | 5 +++++ src/generator.c | 17 ++++++++++++++++- src/stratifier.c | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/connector.c b/src/connector.c index 466cf5de..676f23dc 100644 --- a/src/connector.c +++ b/src/connector.c @@ -499,6 +499,9 @@ static int connector_loop(proc_instance_t *pi, conn_instance_t *ci) goto out; } } while (selret < 1); + + LOGWARNING("%s connector ready", ckp->name); + retry: close(sockd); sockd = accept(us->sockd, NULL, NULL); @@ -595,6 +598,8 @@ int connector(proc_instance_t *pi) const int on = 1; int tries = 0; + LOGWARNING("%s connector starting", ckp->name); + if (ckp->serverurl) { if (!extract_sockaddr(ckp->serverurl, &url, &port)) { LOGWARNING("Failed to extract server address from %s", ckp->serverurl); diff --git a/src/generator.c b/src/generator.c index 85f04c42..b0fc61c5 100644 --- a/src/generator.c +++ b/src/generator.c @@ -193,6 +193,7 @@ static int gen_loop(proc_instance_t *pi) server_instance_t *si = NULL; unixsock_t *us = &pi->us; ckpool_t *ckp = pi->ckp; + bool started = false; char *buf = NULL; connsock_t *cs; gbtbase_t *gbt; @@ -255,8 +256,13 @@ retry: LOGINFO("No best block hash support from %s:%s", cs->url, cs->port); send_unix_msg(sockd, "Failed"); - } else + } else { + if (unlikely(!started)) { + started = true; + LOGWARNING("%s generator ready", ckp->name); + } send_unix_msg(sockd, hash); + } } else if (cmdmatch(buf, "getlast")) { int height = get_blockcount(cs); @@ -269,6 +275,11 @@ retry: send_unix_msg(sockd, "Failed"); goto reconnect; } else { + if (unlikely(!started)) { + started = true; + LOGWARNING("%s generator ready", ckp->name); + } + send_unix_msg(sockd, hash); LOGDEBUG("Hash: %s", hash); } @@ -1330,6 +1341,8 @@ static int proxy_mode(ckpool_t *ckp, proc_instance_t *pi) proxi->cs = &si->cs; } + LOGWARNING("%s generator ready", ckp->name); + ret = proxy_loop(pi); for (i = 0; i < ckp->proxies; i++) { @@ -1358,6 +1371,8 @@ int generator(proc_instance_t *pi) ckpool_t *ckp = pi->ckp; int ret; + LOGWARNING("%s generator starting", ckp->name); + if (ckp->proxy) ret = proxy_mode(ckp, pi); else diff --git a/src/stratifier.c b/src/stratifier.c index 297f5f51..f5e889d0 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -2434,6 +2434,8 @@ int stratifier(proc_instance_t *pi) char *buf; int ret; + LOGWARNING("%s stratifier starting", ckp->name); + /* Store this for use elsewhere */ hex2bin(scriptsig_header_bin, scriptsig_header, 41); address_to_pubkeytxn(pubkeytxnbin, ckp->btcaddress); @@ -2472,6 +2474,8 @@ int stratifier(proc_instance_t *pi) cklock_init(&share_lock); + LOGWARNING("%s stratifier ready", ckp->name); + ret = stratum_loop(ckp, pi); out: return process_exit(ckp, pi, ret);