Browse Source

Make trusted stratifier wait for connector to connect to upstream pool and retry indefinitely instead of failing on first connect.

master
Con Kolivas 8 years ago
parent
commit
890ed35bd9
  1. 9
      src/connector.c
  2. 2
      src/stratifier.c

9
src/connector.c

@ -1234,11 +1234,10 @@ static bool setup_upstream(ckpool_t *ckp, cdata_t *cdata)
cksem_init(&cs->sem); cksem_init(&cs->sem);
cksem_post(&cs->sem); cksem_post(&cs->sem);
/* Must succeed on initial connect to upstream pool */
if (!connect_upstream(ckp, cs)) { while (!connect_upstream(ckp, cs))
LOGEMERG("Failed initial connect to upstream server %s:%s", cs->url, cs->port); cksleep_ms(5000);
goto out;
}
create_pthread(&pth, urecv_process, ckp); create_pthread(&pth, urecv_process, ckp);
cdata->upstream_sends = create_ckmsgq(ckp, "usender", &usend_process); cdata->upstream_sends = create_ckmsgq(ckp, "usender", &usend_process);
ret = true; ret = true;

2
src/stratifier.c

@ -8218,6 +8218,8 @@ void *stratifier(void *arg)
/* Wait for the generator to have something for us */ /* Wait for the generator to have something for us */
while (!ckp->proxy && !ckp->generator_ready) while (!ckp->proxy && !ckp->generator_ready)
cksleep_ms(10); cksleep_ms(10);
while (ckp->remote && !ckp->connector_ready)
cksleep_ms(10);
if (!ckp->proxy) { if (!ckp->proxy) {
if (!generator_checkaddr(ckp, ckp->btcaddress)) { if (!generator_checkaddr(ckp, ckp->btcaddress)) {

Loading…
Cancel
Save