From 21ce4b12d896b48ef9df81d7ab9b0bc8e8417799 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Tue, 22 Oct 2019 09:58:31 +0800 Subject: [PATCH] fix: wrong difficult on the front page https://github.com/moneroexamples/onion-monero-blockchain-explorer/issues/195 --- src/page.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/page.h b/src/page.h index 4fc4521..75adcf5 100644 --- a/src/page.h +++ b/src/page.h @@ -757,9 +757,14 @@ index2(uint64_t page_no = 0, bool refresh_page = false) // perapre network info mstch::map for the front page string hash_rate; + double hr_d; char metric_prefix; - cryptonote::difficulty_type hr = make_difficulty(current_network_info.hash_rate, current_network_info.hash_rate_top64); + + cryptonote::difficulty_type hr = make_difficulty( + current_network_info.hash_rate, + current_network_info.hash_rate_top64); + get_metric_prefix(hr, hr_d, metric_prefix); if (metric_prefix != 0) @@ -778,7 +783,7 @@ index2(uint64_t page_no = 0, bool refresh_page = false) } context["network_info"] = mstch::map { - {"difficulty" , make_difficulty(current_network_info.difficulty, current_network_info.difficulty_top64).str()}, + {"difficulty" , current_network_info.difficulty}, {"hash_rate" , hash_rate}, {"fee_per_kb" , print_money(current_network_info.fee_per_kb)}, {"alt_blocks_no" , current_network_info.alt_blocks_count},