Skip to content

Commit

Permalink
Replace mining.goal.subscribe with mining.capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Nov 1, 2014
1 parent 10bf371 commit 91de01e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,16 @@ bool initiate_stratum(struct pool *pool)
recvd = true;
}

if (uri_get_param_bool(pool->rpc_url, "goalreset", false))
{
// Default: ["notify", "set_difficulty"] (but these must be explicit if mining.capabilities is used)
sprintf(s, "{\"id\":null,\"method\":\"mining.capabilities\",\"params\":[[\"notify\",\"set_difficulty\",\"set_goal\"]");
if (request_target_str)
tailsprintf(s, sizeof(s), ", {\"suggested_target\":\"%s\"}", request_target_str);
tailsprintf(s, sizeof(s), "]}");
_stratum_send(pool, s, strlen(s), true);
}

if (noresume) {
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
} else {
Expand Down Expand Up @@ -3327,11 +3337,6 @@ bool initiate_stratum(struct pool *pool)
sprintf(s, "{\"id\": \"xnsub\", \"method\": \"mining.extranonce.subscribe\", \"params\": []}");
_stratum_send(pool, s, strlen(s), true);
}
if (uri_get_param_bool(pool->rpc_url, "goalreset", false))
{
sprintf(s, "{\"id\": \"goalsub\", \"method\": \"mining.goal.subscribe\", \"params\": []}");
_stratum_send(pool, s, strlen(s), true);
}
} else {
if (recvd)
{
Expand Down

0 comments on commit 91de01e

Please sign in to comment.