Permalink
Browse files

Fix for non-rpc2 solo mining

and update http headers
  • Loading branch information...
1 parent 7e4b0ea commit d0a018a287526888b14d777c28fdb32041833c6a @tpruvot committed Nov 2, 2014
Showing with 10 additions and 5 deletions.
  1. +1 −0 NEWS
  2. +8 −4 cpu-miner.c
  3. +1 −1 util.c
View
@@ -1,6 +1,7 @@
Version 1.0.7 (Tanguy Pruvot)
- Add NIST5 and QUBIT algos
- Show current stratum bloc height
+- Fix wallet solo mining
Version 1.0.6 (Tanguy Pruvot)
- Fix scrypt algo
View
@@ -692,6 +692,10 @@ static bool gbt_work_decode(const json_t *val, struct work *work)
if (version > 2) {
if (version_reduce) {
version = 2;
+ } else if (have_gbt && allow_getwork && !version_force && version == 1024) {
+ applog(LOG_DEBUG, "Switching to getwork");
+ have_gbt = false;
+ goto out;
} else if (!version_force) {
applog(LOG_ERR, "Unrecognized block version: %u", version);
goto out;
@@ -1222,10 +1226,10 @@ static bool get_upstream_work(CURL *curl, struct work *work)
} else
rc = work_decode(json_object_get(val, "result"), work);
- if (opt_debug && rc) {
+ if (opt_protocol && rc) {
timeval_subtract(&diff, &tv_end, &tv_start);
- applog(LOG_DEBUG, "DEBUG: got new work in %d ms",
- diff.tv_sec * 1000 + diff.tv_usec / 1000);
+ applog(LOG_DEBUG, "got new work in %.2f ms",
+ (1000.0 * diff.tv_sec) + (0.001 * diff.tv_usec));
}
json_decref(val);
@@ -1386,7 +1390,7 @@ static void *workio_thread(void *userdata)
return NULL;
}
- if(!have_stratum) {
+ if(jsonrpc_2 && !have_stratum) {
ok = workio_login(curl);
}
View
@@ -442,7 +442,7 @@ json_t *json_rpc_call(CURL *curl, const char *url,
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, len_hdr);
headers = curl_slist_append(headers, "User-Agent: " USER_AGENT);
- headers = curl_slist_append(headers, "X-Mining-Extensions: midstate");
+ headers = curl_slist_append(headers, "X-Mining-Extensions: longpoll reject-reason");
//headers = curl_slist_append(headers, "Accept:"); /* disable Accept hdr*/
//headers = curl_slist_append(headers, "Expect:"); /* disable Expect hdr*/

0 comments on commit d0a018a

Please sign in to comment.