From d923f0c1b254606b24ce345697813b375108e56f Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 21 Jul 2015 02:00:21 +0200 Subject: [PATCH] solo: improve getmininginfo --- ccminer.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ccminer.cpp b/ccminer.cpp index 75b6ae6..0a8c6bb 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -1038,15 +1038,23 @@ static bool get_mininginfo(CURL *curl, struct work *work) // "blocks": 491493 (= current work height - 1) // "difficulty": 0.99607860999999998 // "networkhashps": 56475980 + // "netmhashps": 351.74414726 if (res) { json_t *key = json_object_get(res, "difficulty"); - if (key && json_is_real(key)) { - net_diff = json_real_value(key); + if (key) { + if (!json_is_real(key)) + key = json_object_get(key, "proof-of-work"); + if (json_is_real(key)) + net_diff = json_real_value(key); } key = json_object_get(res, "networkhashps"); if (key && json_is_integer(key)) { net_hashrate = json_integer_value(key); } + key = json_object_get(res, "netmhashps"); + if (key && json_is_real(key)) { + net_hashrate = (json_real_value(key) * 1e6); + } key = json_object_get(res, "blocks"); if (key && json_is_integer(key)) { net_blocks = json_integer_value(key);