Skip to content

Commit

Permalink
Fix authentication issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasjones committed May 23, 2014
1 parent 743b88f commit 7f95c84
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,14 @@ static bool rpc2_login(CURL *curl) {

rc = rpc2_login_decode(val);

json_t *job = json_object_get(val, "job");
json_t *result = json_object_get(val, "result");

if(!result) goto end;

json_t *job = json_object_get(result, "job");

if(!rpc2_job_decode(job, &g_work)) {
return false;
goto end;
}

if (opt_debug && rc) {
Expand Down Expand Up @@ -850,6 +854,10 @@ static void *workio_thread(void *userdata) {
return NULL ;
}

if(!have_stratum) {
ok = workio_login(curl);
}

while (ok) {
struct workio_cmd *wc;

Expand Down Expand Up @@ -1349,7 +1357,7 @@ static bool stratum_handle_response(char *buf) {
if(jsonrpc_2) {
json_t *status = json_object_get(res_val, "status");
if(status) {
char *s = json_string_value(status);
const char *s = json_string_value(status);
valid = !strcmp(s, "OK");
}
} else {
Expand Down

0 comments on commit 7f95c84

Please sign in to comment.