From 7bdd8720c89f30a80ecd0e53d0c2feb5d16da290 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 26 May 2017 07:55:08 +0800 Subject: [PATCH] tx_pool_size_kbytes removed for now as it takes long time. --- src/page.h | 43 ++++++++++++++++---------------- src/templates/mempool_error.html | 5 +++- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/page.h b/src/page.h index 56e10df..d642632 100644 --- a/src/page.h +++ b/src/page.h @@ -774,7 +774,8 @@ namespace xmreg {"difficulty" , j_network_info["difficulty"].get()}, {"hash_rate" , difficulty}, {"fee_per_kb" , print_money(j_network_info["fee_per_kb"])}, - {"alt_blocks_no" , j_network_info["alt_blocks_count"].get()} + {"alt_blocks_no" , j_network_info["alt_blocks_count"].get()}, + {"tx_pool_size" , j_network_info["tx_pool_size"].get()}, }; } } @@ -796,7 +797,7 @@ namespace xmreg else { cerr << "mempool future not ready yet, skipping." << endl; - mempool_html = template_file["mempool_error"]; + mempool_html = mstch::render(template_file["mempool_error"], context); } if (CurrentBlockchainStatus::is_thread_running()) @@ -4823,25 +4824,25 @@ namespace xmreg j_info["fee_per_kb"] = fee_estimated; - // get mempool size in kB. - std::vector mempool_txs; - - if (!rpc.get_mempool(mempool_txs)) - { - j_response["status"] = "error"; - j_response["message"] = "Cant get mempool transactions"; - return j_response; - } - - uint64_t tx_pool_size_kbytes {0}; - - for (const tx_info& tx_i: mempool_txs) - { - tx_pool_size_kbytes += tx_i.blob_size; - } - - j_info["tx_pool_size"] = mempool_txs.size(); - j_info["tx_pool_size_kbytes"] = tx_pool_size_kbytes; +// // get mempool size in kB. +// std::vector mempool_txs; +// +// if (!rpc.get_mempool(mempool_txs)) +// { +// j_response["status"] = "error"; +// j_response["message"] = "Cant get mempool transactions"; +// return j_response; +// } +// +// uint64_t tx_pool_size_kbytes {0}; +// +// for (const tx_info& tx_i: mempool_txs) +// { +// tx_pool_size_kbytes += tx_i.blob_size; +// } +// +// j_info["tx_pool_size"] = mempool_txs.size(); +// j_info["tx_pool_size_kbytes"] = tx_pool_size_kbytes; j_data = j_info; diff --git a/src/templates/mempool_error.html b/src/templates/mempool_error.html index 531a013..0d9946b 100644 --- a/src/templates/mempool_error.html +++ b/src/templates/mempool_error.html @@ -5,9 +5,12 @@

Mempool data preparation for the front page failed. - Its processing took longer than expected and it timed out. + Its processing {{#network_info}}({{tx_pool_size}} txs){{/network_info}} + took longer than expected and it timed out. To view mempool without time constrain, go to dedicated mempool page: memory pool

+ +