Skip to content

Commit

Permalink
debug: a new boolean to log or not json rpc data
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Sep 2, 2014
1 parent 1f99aae commit 1b8c3c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ static const char *algo_names[] = {
};

bool opt_debug = false;
bool opt_debug_rpc = false;
bool opt_protocol = false;
bool opt_benchmark = false;
bool want_longpoll = true;
Expand Down Expand Up @@ -522,6 +523,10 @@ static bool submit_upstream_work(CURL *curl, struct work *work)
json_decref(val);
}

if (opt_debug_rpc) {
applog(LOG_DEBUG, "submit: %s", s);
}

rc = true;

out:
Expand Down Expand Up @@ -1325,6 +1330,7 @@ static void parse_arg (int key, char *arg)
break;
case 'D':
opt_debug = true;
opt_debug_rpc = true;
break;
case 'p':
free(rpc_pass);
Expand Down
1 change: 1 addition & 0 deletions miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ struct work_restart {
};

extern bool opt_debug;
extern bool opt_debug_rpc;
extern bool opt_protocol;
extern int opt_timeout;
extern bool want_longpoll;
Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ bool stratum_handle_method(struct stratum_ctx *sctx, const char *s)
id = json_object_get(val, "id");
params = json_object_get(val, "params");

if (opt_debug) {
if (opt_debug_rpc) {
applog(LOG_DEBUG, "method: %s", s);
}

Expand Down

0 comments on commit 1b8c3c1

Please sign in to comment.