Browse Source

Send a blank sessionid in proxy mode so clients don't think we have resumed if enonce1 ends up matching on reconnect

master
Con Kolivas 10 years ago
parent
commit
45e80f09ff
  1. 12
      src/stratifier.c

12
src/stratifier.c

@ -2672,10 +2672,18 @@ static json_t *parse_subscribe(stratum_instance_t *client, const int64_t client_
/* Workbases will exist if sdata->current_workbase is not NULL */ /* Workbases will exist if sdata->current_workbase is not NULL */
ck_rlock(&sdata->workbase_lock); ck_rlock(&sdata->workbase_lock);
n2len = sdata->workbases->enonce2varlen; n2len = sdata->workbases->enonce2varlen;
JSON_CPACK(ret, "[[[s,s]],s,i]", "mining.notify", client->enonce1, client->enonce1,
n2len);
ck_runlock(&sdata->workbase_lock); ck_runlock(&sdata->workbase_lock);
/* Send a blank sessionid in proxy mode so clients don't think we have
* resumed if enonce1 ends up matching on reconnect. */
if (ckp->proxy) {
JSON_CPACK(ret, "[[[s,s]],s,i]", "mining.notify", "", client->enonce1,
n2len);
} else {
JSON_CPACK(ret, "[[[s,s]],s,i]", "mining.notify", client->enonce1, client->enonce1,
n2len);
}
client->subscribed = true; client->subscribed = true;
return ret; return ret;

Loading…
Cancel
Save