code cleaning

master
moneroexamples 9 years ago
parent 3f2781e4f5
commit e225e82cd7

@ -30,9 +30,10 @@ int main(int ac, const char* av[]) {
return 0; return 0;
} }
auto port_opt = opts.get_option<string>("port"); auto port_opt = opts.get_option<string>("port");
auto bc_path_opt = opts.get_option<string>("bc-path"); auto bc_path_opt = opts.get_option<string>("bc-path");
auto deamon_url_opt = opts.get_option<string>("deamon-url"); auto custom_db_path_opt = opts.get_option<string>("custom-db-path");
auto deamon_url_opt = opts.get_option<string>("deamon-url");
//cast port number in string to uint16 //cast port number in string to uint16
uint16_t app_port = boost::lexical_cast<uint16_t>(*port_opt); uint16_t app_port = boost::lexical_cast<uint16_t>(*port_opt);

@ -18,7 +18,7 @@ namespace xmreg
p.add("txhash", -1); p.add("txhash", -1);
options_description desc( options_description desc(
"showmixins, shows mixin outputs used for each input in a given transaction"); "xmrblocks, start Onion Monero Blockchain Explorer");
desc.add_options() desc.add_options()
("help,h", value<bool>()->default_value(false)->implicit_value(true), ("help,h", value<bool>()->default_value(false)->implicit_value(true),
@ -27,6 +27,8 @@ namespace xmreg
"default port") "default port")
("bc-path,b", value<string>(), ("bc-path,b", value<string>(),
"path to lmdb blockchain") "path to lmdb blockchain")
("custom-db-path,c", value<string>(),
"path to the custom lmdb database used for searching things")
("deamon-url,d", value<string>()->default_value("http:://127.0.0.1:18081"), ("deamon-url,d", value<string>()->default_value("http:://127.0.0.1:18081"),
"monero address string"); "monero address string");

@ -215,6 +215,9 @@ namespace xmreg {
/** /**
* @brief Show recent blocks and mempool * @brief Show recent blocks and mempool
*
* Not used currently. index2 method is used instead
*
* @param page_no block page to show * @param page_no block page to show
* @param refresh_page enable autorefresh * @param refresh_page enable autorefresh
* @return rendered index page * @return rendered index page
@ -567,6 +570,9 @@ namespace xmreg {
} }
/**
* Render mempool data
*/
string string
mempool() mempool()
{ {
@ -1241,10 +1247,6 @@ namespace xmreg {
tx_hashes["encrypted_payments_id"] = {}; tx_hashes["encrypted_payments_id"] = {};
tx_hashes["output_public_keys"] = {}; tx_hashes["output_public_keys"] = {};
cout << "txs.size(): " << txs.size() << endl;
cout << "search_text: " << search_text << endl;
for (const transaction& tx: txs) for (const transaction& tx: txs)
{ {
@ -1268,15 +1270,11 @@ namespace xmreg {
// check if tx_public_key matches the search_text // 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) if (pod_to_hex(txd.pk) == search_text)
{ {
tx_hashes["tx_public_keys"].push_back(tx_hash_str); 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 // check if payments_id matches the search_text
if (pod_to_hex(txd.payment_id) == search_text) if (pod_to_hex(txd.payment_id) == search_text)

Loading…
Cancel
Save