Skip to content

Commit

Permalink
rpc: use the user agent constant
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Oct 17, 2014
1 parent df27be4 commit d213fe9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,8 @@ static bool rpc2_login(CURL *curl)
return false;

snprintf(s, JSON_BUF_LEN, "{\"method\": \"login\", \"params\": {"
"\"login\": \"%s\", \"pass\": \"%s\", \"agent\": \"cpuminer-multi/0.1\"}, \"id\": 1}",
rpc_user, rpc_pass);
"\"login\": \"%s\", \"pass\": \"%s\", \"agent\": \"%s\"}, \"id\": 1}",
rpc_user, rpc_pass, USER_AGENT);

gettimeofday(&tv_start, NULL);
val = json_rpc_call(curl, rpc_url, rpc_userpass, s, NULL, 0);
Expand Down
4 changes: 2 additions & 2 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,8 @@ bool stratum_authorize(struct stratum_ctx *sctx, const char *user, const char *p
if (jsonrpc_2) {
s = malloc(300 + strlen(user) + strlen(pass));
sprintf(s, "{\"method\": \"login\", \"params\": {"
"\"login\": \"%s\", \"pass\": \"%s\", \"agent\": \"cpuminer-multi/1.0\"}, \"id\": 1}",
user, pass);
"\"login\": \"%s\", \"pass\": \"%s\", \"agent\": \"%s\"}, \"id\": 1}",
user, pass, USER_AGENT);
} else {
s = malloc(80 + strlen(user) + strlen(pass));
sprintf(s, "{\"id\": 2, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}",
Expand Down

0 comments on commit d213fe9

Please sign in to comment.