mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
Search results limited to 500.
This commit is contained in:
parent
f3bb37b4b8
commit
e98ee5170f
2 changed files with 17 additions and 2 deletions
13
src/page.h
13
src/page.h
|
@ -1189,6 +1189,7 @@ namespace xmreg {
|
||||||
mstch::map context {
|
mstch::map context {
|
||||||
{"search_text", search_text},
|
{"search_text", search_text},
|
||||||
{"no_results" , true},
|
{"no_results" , true},
|
||||||
|
{"to_many_results", false}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const pair<string, vector<string>>& found_txs: all_possible_tx_hashes)
|
for (const pair<string, vector<string>>& found_txs: all_possible_tx_hashes)
|
||||||
|
@ -1206,6 +1207,8 @@ namespace xmreg {
|
||||||
if (!found_txs.second.empty())
|
if (!found_txs.second.empty())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
uint64_t tx_i {0};
|
||||||
|
|
||||||
// for each found tx_hash, get the corresponding tx
|
// for each found tx_hash, get the corresponding tx
|
||||||
// and its details, and put into mstch for rendering
|
// and its details, and put into mstch for rendering
|
||||||
for (const string& tx_hash: found_txs.second)
|
for (const string& tx_hash: found_txs.second)
|
||||||
|
@ -1221,11 +1224,19 @@ namespace xmreg {
|
||||||
tx_details txd = get_tx_details(tx);
|
tx_details txd = get_tx_details(tx);
|
||||||
|
|
||||||
boost::get<mstch::array>((res.first)->second).push_back(txd.get_mstch_map());
|
boost::get<mstch::array>((res.first)->second).push_back(txd.get_mstch_map());
|
||||||
|
|
||||||
|
// dont show more than 500 results
|
||||||
|
if (tx_i > 500)
|
||||||
|
{
|
||||||
|
context["to_many_results"] = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
++tx_i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if found something, set this flag to indicate this fact
|
// if found something, set this flag to indicate this fact
|
||||||
context["no_results"] = false;
|
context["no_results"] = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
and there might be 1-2 min delay betweem my blockchain others</h5>
|
and there might be 1-2 min delay betweem my blockchain others</h5>
|
||||||
{{/no_results}}
|
{{/no_results}}
|
||||||
|
|
||||||
|
{{#to_many_results}}
|
||||||
|
<h3>More than 500 results found. Showing no more than this</h3>
|
||||||
|
{{/to_many_results}}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
{{#has_key_images}}
|
{{#has_key_images}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue