Search results limited to 500.

master
moneroexamples 9 years ago
parent f3bb37b4b8
commit e98ee5170f

@ -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…
Cancel
Save