Browse Source

Add messages for when each process is ready

master
Con Kolivas 11 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;
}
} 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);

17
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

4
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);

Loading…
Cancel
Save