From 6a7e1bcc37308d16ee7fc61c402fbda7790691d1 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 26 Apr 2014 01:25:42 +1000 Subject: [PATCH] Add fake submit parsing and poll every second instead of millisecond --- src/connector.c | 2 +- src/stratifier.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/connector.c b/src/connector.c index 7dc17000..6d2f3e85 100644 --- a/src/connector.c +++ b/src/connector.c @@ -195,7 +195,7 @@ retry: } ck_runlock(&ci->lock); - ret = poll(fds, nfds, 1); + ret = poll(fds, nfds, 1000); if (ret < 0) { if (interrupted()) goto retry; diff --git a/src/stratifier.c b/src/stratifier.c index a28f0e30..7d3d9933 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -612,6 +612,11 @@ out: return json_boolean(ret); } +static json_t *parse_submit(stratum_instance_t *client, json_t *params_val, json_t **err_val) +{ + return json_boolean(true); +} + /* We should have already determined all the values passed to this are valid * by now. Set update if we should also send the latest stratum parameters */ static json_t *gen_json_result(int client_id, json_t *method_val, json_t *params_val, @@ -642,6 +647,9 @@ static json_t *gen_json_result(int client_id, json_t *method_val, json_t *params if (!client->authorised) return json_string("Unauthorised"); + if (!strncasecmp(method, "mining.submit", 13)) + return parse_submit(client, params_val, err_val); + return json_string("Empty"); }