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. 10
      src/stratifier.c

10
src/stratifier.c

@ -2672,9 +2672,17 @@ 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;
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, JSON_CPACK(ret, "[[[s,s]],s,i]", "mining.notify", client->enonce1, client->enonce1,
n2len); n2len);
ck_runlock(&sdata->workbase_lock); }
client->subscribed = true; client->subscribed = true;

Loading…
Cancel
Save