Browse Source

Add messages for when each process is ready

master
Con Kolivas 10 years ago
parent
commit
fd45d582d4
  1. 5
      src/connector.c
  2. 17
      src/generator.c
  3. 4
      src/stratifier.c

5
src/connector.c

@ -499,6 +499,9 @@ static int connector_loop(proc_instance_t *pi, conn_instance_t *ci)
goto out; goto out;
} }
} while (selret < 1); } while (selret < 1);
LOGWARNING("%s connector ready", ckp->name);
retry: retry:
close(sockd); close(sockd);
sockd = accept(us->sockd, NULL, NULL); sockd = accept(us->sockd, NULL, NULL);
@ -595,6 +598,8 @@ int connector(proc_instance_t *pi)
const int on = 1; const int on = 1;
int tries = 0; int tries = 0;
LOGWARNING("%s connector starting", ckp->name);
if (ckp->serverurl) { if (ckp->serverurl) {
if (!extract_sockaddr(ckp->serverurl, &url, &port)) { if (!extract_sockaddr(ckp->serverurl, &url, &port)) {
LOGWARNING("Failed to extract server address from %s", ckp->serverurl); LOGWARNING("Failed to extract server address from %s", ckp->serverurl);

17
src/generator.c

@ -193,6 +193,7 @@ static int gen_loop(proc_instance_t *pi)
server_instance_t *si = NULL; server_instance_t *si = NULL;
unixsock_t *us = &pi->us; unixsock_t *us = &pi->us;
ckpool_t *ckp = pi->ckp; ckpool_t *ckp = pi->ckp;
bool started = false;
char *buf = NULL; char *buf = NULL;
connsock_t *cs; connsock_t *cs;
gbtbase_t *gbt; gbtbase_t *gbt;
@ -255,8 +256,13 @@ retry:
LOGINFO("No best block hash support from %s:%s", LOGINFO("No best block hash support from %s:%s",
cs->url, cs->port); cs->url, cs->port);
send_unix_msg(sockd, "Failed"); send_unix_msg(sockd, "Failed");
} else } else {
if (unlikely(!started)) {
started = true;
LOGWARNING("%s generator ready", ckp->name);
}
send_unix_msg(sockd, hash); send_unix_msg(sockd, hash);
}
} else if (cmdmatch(buf, "getlast")) { } else if (cmdmatch(buf, "getlast")) {
int height = get_blockcount(cs); int height = get_blockcount(cs);
@ -269,6 +275,11 @@ retry:
send_unix_msg(sockd, "Failed"); send_unix_msg(sockd, "Failed");
goto reconnect; goto reconnect;
} else { } else {
if (unlikely(!started)) {
started = true;
LOGWARNING("%s generator ready", ckp->name);
}
send_unix_msg(sockd, hash); send_unix_msg(sockd, hash);
LOGDEBUG("Hash: %s", hash); LOGDEBUG("Hash: %s", hash);
} }
@ -1330,6 +1341,8 @@ static int proxy_mode(ckpool_t *ckp, proc_instance_t *pi)
proxi->cs = &si->cs; proxi->cs = &si->cs;
} }
LOGWARNING("%s generator ready", ckp->name);
ret = proxy_loop(pi); ret = proxy_loop(pi);
for (i = 0; i < ckp->proxies; i++) { for (i = 0; i < ckp->proxies; i++) {
@ -1358,6 +1371,8 @@ int generator(proc_instance_t *pi)
ckpool_t *ckp = pi->ckp; ckpool_t *ckp = pi->ckp;
int ret; int ret;
LOGWARNING("%s generator starting", ckp->name);
if (ckp->proxy) if (ckp->proxy)
ret = proxy_mode(ckp, pi); ret = proxy_mode(ckp, pi);
else else

4
src/stratifier.c

@ -2434,6 +2434,8 @@ int stratifier(proc_instance_t *pi)
char *buf; char *buf;
int ret; int ret;
LOGWARNING("%s stratifier starting", ckp->name);
/* Store this for use elsewhere */ /* Store this for use elsewhere */
hex2bin(scriptsig_header_bin, scriptsig_header, 41); hex2bin(scriptsig_header_bin, scriptsig_header, 41);
address_to_pubkeytxn(pubkeytxnbin, ckp->btcaddress); address_to_pubkeytxn(pubkeytxnbin, ckp->btcaddress);
@ -2472,6 +2474,8 @@ int stratifier(proc_instance_t *pi)
cklock_init(&share_lock); cklock_init(&share_lock);
LOGWARNING("%s stratifier ready", ckp->name);
ret = stratum_loop(ckp, pi); ret = stratum_loop(ckp, pi);
out: out:
return process_exit(ckp, pi, ret); return process_exit(ckp, pi, ret);

Loading…
Cancel
Save