diff --git a/src/monero_headers.h b/src/monero_headers.h index 39a72f8..d33b7c0 100644 --- a/src/monero_headers.h +++ b/src/monero_headers.h @@ -15,8 +15,6 @@ #define OUTPUT_EXPORT_FILE_MAGIC "Monero output export\003" -#include "net/http_base.h" -#include "net/http_server_handlers_map2.h" #include "net/http_client.h" #include "storages/http_abstract_invoke.h" diff --git a/src/page.h b/src/page.h index 763e5a1..66ec4ca 100644 --- a/src/page.h +++ b/src/page.h @@ -656,11 +656,14 @@ public: mstch::map context { {"mempool_size", std::to_string(mempool_txs.size())}, }; + context.emplace("mempooltxs" , mstch::array()); // get reference to blocks template map to be field below mstch::array& txs = boost::get(context["mempooltxs"]); + uint64_t mempool_size_bytes {0}; + // for each transaction in the memory pool for (size_t i = 0; i < mempool_txs.size(); ++i) { @@ -744,10 +747,16 @@ public: {"is_ringct" , is_ringct_str}, {"rct_type" , rct_type_str}, {"mixin" , fmt::format("{:d}", mixin_no)}, - {"txsize" , fmt::format("{:0.2f}", static_cast(_tx_info.blob_size)/1024.0)} + {"txsize" , fmt::format("{:0.2f}", + static_cast(_tx_info.blob_size)/1024.0)} }); + + mempool_size_bytes += _tx_info.blob_size; } + context.insert({"mempool_size_kB", + fmt::format("{:0.2f}", static_cast(mempool_size_bytes)/1024.0)}); + // sort txs in mempool based on their age std::sort(txs.begin(), txs.end(), [](mstch::node& m1, mstch::node& m2) { diff --git a/src/templates/mempool.html b/src/templates/mempool.html index 6ea7afe..05f79a5 100644 --- a/src/templates/mempool.html +++ b/src/templates/mempool.html @@ -1,5 +1,5 @@

- Memory pool (size: {{mempool_size}}) + Memory pool (no of txs: {{mempool_size}}, size: {{mempool_size_kB}} kB)