Skip to content

Commit

Permalink
stratum: show reason of auth failure
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Jan 16, 2018
1 parent 50781f0 commit b71f85e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util.cpp
Expand Up @@ -1354,7 +1354,11 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p

if (!res_val || json_is_false(res_val) ||
(err_val && !json_is_null(err_val))) {
applog(LOG_ERR, "Stratum authentication failed");
if (err_val && json_is_array(err_val)) {
const char* reason = json_string_value(json_array_get(err_val, 1));
applog(LOG_ERR, "Stratum authentication failed (%s)", reason);
}
else applog(LOG_ERR, "Stratum authentication failed");
goto out;
}

Expand Down

0 comments on commit b71f85e

Please sign in to comment.