Browse Source

Don't allow passthrough subclients to reconnect

master
Con Kolivas 9 years ago
parent
commit
21f80c3ecf
  1. 8
      src/stratifier.c

8
src/stratifier.c

@ -3343,6 +3343,12 @@ out_unlock:
return ret; return ret;
} }
/* passthrough subclients have client_ids in the high bits */
static inline bool passthrough_subclient(const int64_t client_id)
{
return (client_id > 0xffffffffll);
}
/* Extranonce1 must be set here. Needs to be entered with client holding a ref /* Extranonce1 must be set here. Needs to be entered with client holding a ref
* count. */ * count. */
static json_t *parse_subscribe(stratum_instance_t *client, const int64_t client_id, const json_t *params_val) static json_t *parse_subscribe(stratum_instance_t *client, const int64_t client_id, const json_t *params_val)
@ -3386,7 +3392,7 @@ static json_t *parse_subscribe(stratum_instance_t *client, const int64_t client_
session_id = int_from_sessionid(buf); session_id = int_from_sessionid(buf);
LOGDEBUG("Found old session id %d", session_id); LOGDEBUG("Found old session id %d", session_id);
} }
if (!ckp->proxy && session_id) { if (!ckp->proxy && session_id && !passthrough_subclient(client_id)) {
if ((client->enonce1_64 = disconnected_sessionid_exists(sdata, session_id, client_id))) { if ((client->enonce1_64 = disconnected_sessionid_exists(sdata, session_id, client_id))) {
sprintf(client->enonce1, "%016lx", client->enonce1_64); sprintf(client->enonce1, "%016lx", client->enonce1_64);
old_match = true; old_match = true;

Loading…
Cancel
Save