From e225e82cd76a681369d30f4127e6b3833ddd316d Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sat, 7 May 2016 18:33:56 +0800 Subject: [PATCH] code cleaning --- main.cpp | 7 ++++--- src/CmdLineOptions.cpp | 4 +++- src/page.h | 14 ++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/main.cpp b/main.cpp index 29154db..926630c 100644 --- a/main.cpp +++ b/main.cpp @@ -30,9 +30,10 @@ int main(int ac, const char* av[]) { return 0; } - auto port_opt = opts.get_option("port"); - auto bc_path_opt = opts.get_option("bc-path"); - auto deamon_url_opt = opts.get_option("deamon-url"); + auto port_opt = opts.get_option("port"); + auto bc_path_opt = opts.get_option("bc-path"); + auto custom_db_path_opt = opts.get_option("custom-db-path"); + auto deamon_url_opt = opts.get_option("deamon-url"); //cast port number in string to uint16 uint16_t app_port = boost::lexical_cast(*port_opt); diff --git a/src/CmdLineOptions.cpp b/src/CmdLineOptions.cpp index 5c66053..d6af3fc 100644 --- a/src/CmdLineOptions.cpp +++ b/src/CmdLineOptions.cpp @@ -18,7 +18,7 @@ namespace xmreg p.add("txhash", -1); options_description desc( - "showmixins, shows mixin outputs used for each input in a given transaction"); + "xmrblocks, start Onion Monero Blockchain Explorer"); desc.add_options() ("help,h", value()->default_value(false)->implicit_value(true), @@ -27,6 +27,8 @@ namespace xmreg "default port") ("bc-path,b", value(), "path to lmdb blockchain") + ("custom-db-path,c", value(), + "path to the custom lmdb database used for searching things") ("deamon-url,d", value()->default_value("http:://127.0.0.1:18081"), "monero address string"); diff --git a/src/page.h b/src/page.h index 7a762a7..6565a24 100644 --- a/src/page.h +++ b/src/page.h @@ -215,6 +215,9 @@ namespace xmreg { /** * @brief Show recent blocks and mempool + * + * Not used currently. index2 method is used instead + * * @param page_no block page to show * @param refresh_page enable autorefresh * @return rendered index page @@ -567,6 +570,9 @@ namespace xmreg { } + /** + * Render mempool data + */ string mempool() { @@ -1241,10 +1247,6 @@ namespace xmreg { tx_hashes["encrypted_payments_id"] = {}; tx_hashes["output_public_keys"] = {}; - cout << "txs.size(): " << txs.size() << endl; - - cout << "search_text: " << search_text << endl; - for (const transaction& tx: txs) { @@ -1268,15 +1270,11 @@ namespace xmreg { // check if tx_public_key matches the search_text - cout << "txd.pk: " << pod_to_hex(txd.pk) << endl; - if (pod_to_hex(txd.pk) == search_text) { tx_hashes["tx_public_keys"].push_back(tx_hash_str); } - cout << "txd.payment_id: " << txd.payment_id << endl; - // check if payments_id matches the search_text if (pod_to_hex(txd.payment_id) == search_text)