Sort addresses by amounts in descending order

This commit is contained in:
Duke Leto
2018-07-20 04:40:34 +00:00
parent c4a73444de
commit 70748123a9

View File

@@ -465,7 +465,7 @@ extern UniValue CBlockTreeDB::Snapshot()
for (std::pair<std::string, CAmount> element : addressAmounts) {
vaddr.push_back( make_pair(element.second, element.first) );
}
std::sort(vaddr.begin(), vaddr.end());
std::sort(vaddr.rbegin(), vaddr.rend());
UniValue obj(UniValue::VOBJ);
UniValue addressesSorted(UniValue::VARR);