From 45e80f09ffcf46ef4a79f33b2b6d5513cf13e7b4 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 27 Feb 2015 11:39:12 +1100 Subject: [PATCH] Send a blank sessionid in proxy mode so clients don't think we have resumed if enonce1 ends up matching on reconnect --- src/stratifier.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 694b47c9..50aa5cfb 100644 --- a/src/stratifier.c +++ b/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 */ ck_rlock(&sdata->workbase_lock); n2len = sdata->workbases->enonce2varlen; - JSON_CPACK(ret, "[[[s,s]],s,i]", "mining.notify", client->enonce1, client->enonce1, - n2len); 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; return ret;