code cleaning

This commit is contained in:
moneroexamples 2016-05-07 18:33:56 +08:00
parent 3f2781e4f5
commit e225e82cd7
3 changed files with 13 additions and 12 deletions

View File

@ -30,9 +30,10 @@ int main(int ac, const char* av[]) {
return 0;
}
auto port_opt = opts.get_option<string>("port");
auto bc_path_opt = opts.get_option<string>("bc-path");
auto deamon_url_opt = opts.get_option<string>("deamon-url");
auto port_opt = opts.get_option<string>("port");
auto bc_path_opt = opts.get_option<string>("bc-path");
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
uint16_t app_port = boost::lexical_cast<uint16_t>(*port_opt);

View File

@ -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<bool>()->default_value(false)->implicit_value(true),
@ -27,6 +27,8 @@ namespace xmreg
"default port")
("bc-path,b", value<string>(),
"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"),
"monero address string");

View File

@ -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)