sort txpool txs

This commit is contained in:
moneroexamples 2018-10-22 09:23:13 +08:00
parent ce6f81fd2a
commit 77d2a98e2f
1 changed files with 12 additions and 0 deletions

View File

@ -124,6 +124,18 @@ MempoolStatus::read_mempool()
(void) pool_key_image_info;
// sort txpool txs
// mempool txs are not sorted base on their arival time,
// so we sort it here.
std::sort(mempool_tx_info.begin(), mempool_tx_info.end(),
[](tx_info& t1, tx_info& t2)
{
return t1.receive_time > t2.receive_time;
});
// if dont have tx_blob member, construct tx
// from json obtained from the rpc call