mirror of
https://git.wownero.com/wownero/onion-wownero-blockchain-explorer.git
synced 2024-08-15 00:33:12 +00:00
mempool txs are sorted by age now
This commit is contained in:
parent
68cc814b30
commit
9d22729be0
1 changed files with 10 additions and 0 deletions
10
src/page.h
10
src/page.h
|
@ -732,6 +732,7 @@ public:
|
||||||
|
|
||||||
// set output page template map
|
// set output page template map
|
||||||
txs.push_back(mstch::map {
|
txs.push_back(mstch::map {
|
||||||
|
{"timestamp_no" , _tx_info.receive_time},
|
||||||
{"timestamp" , xmreg::timestamp_to_str(_tx_info.receive_time)},
|
{"timestamp" , xmreg::timestamp_to_str(_tx_info.receive_time)},
|
||||||
{"age" , age_str},
|
{"age" , age_str},
|
||||||
{"hash" , fmt::format("{:s}", _tx_info.id_hash)},
|
{"hash" , fmt::format("{:s}", _tx_info.id_hash)},
|
||||||
|
@ -747,6 +748,15 @@ public:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sort txs in mempool based on their age
|
||||||
|
std::sort(txs.begin(), txs.end(), [](mstch::node& m1, mstch::node& m2)
|
||||||
|
{
|
||||||
|
uint64_t t1 = boost::get<uint64_t>(boost::get<mstch::map>(m1)["timestamp_no"]);
|
||||||
|
uint64_t t2 = boost::get<uint64_t>(boost::get<mstch::map>(m2)["timestamp_no"]);
|
||||||
|
|
||||||
|
return t1 > t2;
|
||||||
|
});
|
||||||
|
|
||||||
// read index.html
|
// read index.html
|
||||||
string mempool_html = xmreg::read(TMPL_MEMPOOL);
|
string mempool_html = xmreg::read(TMPL_MEMPOOL);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue