Browse Source

Reverse the waiting order between generator and stratifier in proxy mode

master
Con Kolivas 10 years ago
parent
commit
9de62bdea9
  1. 12
      src/generator.c
  2. 5
      src/stratifier.c

12
src/generator.c

@ -2159,12 +2159,22 @@ int generator(proc_instance_t *pi)
ckp->data = gdata;
gdata->ckp = ckp;
if (ckp->proxy) {
char *buf;
/* Wait for the stratifier to be ready for us */
do {
if (!ping_main(ckp)) {
ret = 1;
goto out;
}
buf = send_recv_proc(ckp->stratifier, "ping");
} while (!buf);
ret = proxy_mode(ckp, pi);
} else {
gdata->srvchk = create_ckmsgq(ckp, "srvchk", &server_watchdog);
ret = server_mode(ckp, pi);
}
out:
dealloc(ckp->data);
return process_exit(ckp, pi, ret);
}

5
src/stratifier.c

@ -4909,8 +4909,11 @@ int stratifier(proc_instance_t *pi)
ret = 1;
goto out;
}
if (ckp->proxy)
break;
buf = send_recv_proc(ckp->generator, "ping");
} while (!buf);
dealloc(buf);
if (!ckp->proxy) {
if (!test_address(ckp, ckp->btcaddress)) {
@ -4935,8 +4938,6 @@ int stratifier(proc_instance_t *pi)
sdata->blockchange_id = sdata->workbase_id = randomiser;
sdata->enonce1u.u64 = htobe64(randomiser);
dealloc(buf);
if (!ckp->serverurls) {
ckp->serverurl[0] = "127.0.0.1";
ckp->serverurls = 1;

Loading…
Cancel
Save