From 1b8c3c12fa5bb83afbb02f9d5f60586939f36d86 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 2 Sep 2014 03:38:57 +0200 Subject: [PATCH] debug: a new boolean to log or not json rpc data --- cpu-miner.c | 6 ++++++ miner.h | 1 + util.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cpu-miner.c b/cpu-miner.c index d92c7e0..9ff8375 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -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) 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) break; case 'D': opt_debug = true; + opt_debug_rpc = true; break; case 'p': free(rpc_pass); diff --git a/miner.h b/miner.h index e1e2d8d..c9b2e44 100644 --- a/miner.h +++ b/miner.h @@ -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; diff --git a/util.c b/util.c index 6fd2b71..a9e0ae2 100644 --- a/util.c +++ b/util.c @@ -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); }