mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
cheking if lexical_cast is ok
This commit is contained in:
parent
356e97f411
commit
06675305ba
1 changed files with 19 additions and 6 deletions
15
src/page.h
15
src/page.h
|
@ -870,7 +870,13 @@ namespace xmreg {
|
|||
// first check if searching for block of given height
|
||||
if (search_text.size() < 12)
|
||||
{
|
||||
result_html = show_block(boost::lexical_cast<uint64_t>(search_text));
|
||||
uint64_t blk_height;
|
||||
|
||||
try
|
||||
{
|
||||
blk_height = boost::lexical_cast<uint64_t>(search_text);
|
||||
|
||||
result_html = show_block(blk_height);
|
||||
|
||||
// nasty check if output is "Cant get" as a sign of
|
||||
// a not found tx. Later need to think of something better.
|
||||
|
@ -878,6 +884,13 @@ namespace xmreg {
|
|||
{
|
||||
return result_html;
|
||||
}
|
||||
|
||||
}
|
||||
catch(boost::bad_lexical_cast &e)
|
||||
{
|
||||
cerr << search_text << " is not a number" << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// second let try searching for tx
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue