searching for key images added

master
moneroexamples 9 years ago
parent 87c3232551
commit 9720838763

@ -595,7 +595,7 @@ namespace xmreg {
if (!xmreg::parse_str_secret_key(_blk_hash, blk_hash)) if (!xmreg::parse_str_secret_key(_blk_hash, blk_hash))
{ {
cerr << "Cant parse blk hash: " << blk_hash << endl; cerr << "Cant parse blk hash: " << blk_hash << endl;
return fmt::format("Cant get block {:s}!", blk_hash); return fmt::format("Cant get block {:s} due to block hash parse error!", blk_hash);
} }
uint64_t blk_height; uint64_t blk_height;
@ -607,12 +607,12 @@ namespace xmreg {
catch (const BLOCK_DNE& e) catch (const BLOCK_DNE& e)
{ {
cerr << "Block does not exist: " << blk_hash << endl; cerr << "Block does not exist: " << blk_hash << endl;
return fmt::format("Cant get block {:s}!", blk_hash); return fmt::format("Cant get block {:s} because it does not exist!", blk_hash);
} }
catch (const std::exception& e) catch (const std::exception& e)
{ {
cerr << "Cant get block: " << blk_hash << endl; cerr << "Cant get block: " << blk_hash << endl;
return fmt::format("Cant get block {:s}!", blk_hash); return fmt::format("Cant get block {:s} for some uknown reason", blk_hash);
} }
return show_block(blk_height); return show_block(blk_height);
@ -884,7 +884,9 @@ namespace xmreg {
// remove white characters // remove white characters
boost::trim(search_text); boost::trim(search_text);
string result_html {"No such thing found: " + search_text}; string default_txt {"No such thing found: " + search_text};
string result_html {default_txt};
// first check if searching for block of given height // first check if searching for block of given height
@ -932,6 +934,8 @@ namespace xmreg {
return result_html; return result_html;
} }
result_html = default_txt;
xmreg::MyLMDB mylmdb {"/home/mwo/.bitmonero/lmdb2"}; xmreg::MyLMDB mylmdb {"/home/mwo/.bitmonero/lmdb2"};
vector<string> tx_hashes = mylmdb.search(search_text, "key_images"); vector<string> tx_hashes = mylmdb.search(search_text, "key_images");

@ -87,7 +87,7 @@
<div class="center"> <div class="center">
<form action="/search" method="get" style="width:100%; margin-top:10px" class="style-1"> <form action="/search" method="get" style="width:100%; margin-top:10px" class="style-1">
<input type="text" name="value" size="100" <input type="text" name="value" size="100"
placeholder="block height, block hash, tx hash, tx payment id, input key image or output public key "> placeholder="block height, block hash, tx hash, tx payment id, tx public key, input key image or output public key ">
<input type="submit" value="Search"> <input type="submit" value="Search">
</form> </form>
</div> </div>

Loading…
Cancel
Save