Browse Source

debug: a new boolean to log or not json rpc data

master
Tanguy Pruvot 10 years ago
parent
commit
1b8c3c12fa
  1. 6
      cpu-miner.c
  2. 1
      miner.h
  3. 2
      util.c

6
cpu-miner.c

@ -168,6 +168,7 @@ static const char *algo_names[] = { @@ -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;
@ -522,6 +523,10 @@ static bool submit_upstream_work(CURL *curl, struct work *work) @@ -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:
@ -1325,6 +1330,7 @@ static void parse_arg (int key, char *arg) @@ -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);

1
miner.h

@ -285,6 +285,7 @@ struct work_restart { @@ -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;

2
util.c

@ -1205,7 +1205,7 @@ bool stratum_handle_method(struct stratum_ctx *sctx, const char *s) @@ -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);
}

Loading…
Cancel
Save