Browse Source

Remove the unused msg_id field

master
Con Kolivas 10 years ago
parent
commit
08a997e190
  1. 6
      src/generator.c
  2. 12
      src/stratifier.c

6
src/generator.c

@ -49,7 +49,6 @@ struct share_msg {
int64_t id; // Our own id for submitting upstream
int client_id;
int msg_id; // Stratum message id from client
time_t submit_time;
};
@ -1398,7 +1397,6 @@ static void submit_share(gdata_t *gdata, json_t *val)
share = ckzalloc(sizeof(share_msg_t));
share->submit_time = time(NULL);
share->client_id = client_id;
json_get_int(&share->msg_id, val, "msg_id");
msg->json_msg = val;
/* Add new share entry to the share hashtable */
@ -1459,8 +1457,8 @@ static bool parse_share(proxy_instance_t *proxi, const char *buf)
proxi->id, proxi->subid, buf);
goto out;
}
LOGINFO("Proxy %d:%d share result %s from client %d with msg_id %d", proxi->id,
proxi->subid, buf, share->client_id, share->msg_id);
LOGINFO("Proxy %d:%d share result %s from client %d", proxi->id, proxi->subid,
buf, share->client_id);
free(share);
out:
if (val)

12
src/stratifier.c

@ -3505,7 +3505,7 @@ static void update_client(const stratum_instance_t *client, const int64_t client
/* Submit a share in proxy mode to the parent pool. workbase_lock is held.
* Needs to be entered with client holding a ref count. */
static void submit_share(stratum_instance_t *client, const int64_t jobid, const char *nonce2,
const char *ntime, const char *nonce, const int msg_id)
const char *ntime, const char *nonce)
{
ckpool_t *ckp = client->ckp;
json_t *json_msg;
@ -3513,10 +3513,9 @@ static void submit_share(stratum_instance_t *client, const int64_t jobid, const
char *msg;
sprintf(enonce2, "%s%s", client->enonce1var, nonce2);
JSON_CPACK(json_msg, "{sIsssssssIsisisi}", "jobid", jobid, "nonce2", enonce2,
JSON_CPACK(json_msg, "{sIsssssssIsisi}", "jobid", jobid, "nonce2", enonce2,
"ntime", ntime, "nonce", nonce, "client_id", client->id,
"msg_id", msg_id, "proxy", client->proxyid,
"subproxy", client->subproxyid);
"proxy", client->proxyid, "subproxy", client->subproxyid);
msg = json_dumps(json_msg, 0);
json_decref(json_msg);
send_generator(ckp, msg, GEN_LAX);
@ -3697,11 +3696,8 @@ out_unlock:
/* Submit share to upstream pool in proxy mode. We submit valid and
* stale shares and filter out the rest. */
if (wb && wb->proxy && submit) {
int msg_id = 0;
json_get_int(&msg_id, json_msg, "id");
LOGINFO("Submitting share upstream: %s", hexhash);
submit_share(client, id, nonce2, ntime, nonce, msg_id);
submit_share(client, id, nonce2, ntime, nonce);
}
add_submit(ckp, client, diff, result, submit);

Loading…
Cancel
Save