rpc: only sort when combining multiple results

It's only necessary to sort when combining results for several addresses
as the results are already in order from the database.
This commit is contained in:
Braydon Fuller 2016-03-16 14:50:19 -04:00 committed by Simon
parent 8432e73cf2
commit 72bd01411d
1 changed files with 3 additions and 1 deletions

View File

@ -572,7 +572,9 @@ UniValue getaddresstxids(const UniValue& params, bool fHelp)
}
}
std::sort(vtxids.begin(), vtxids.end());
if (addresses.size() > 1) {
std::sort(vtxids.begin(), vtxids.end());
}
UniValue result(UniValue::VARR);
for (std::vector<std::pair<int, std::string> >::const_iterator it=vtxids.begin(); it!=vtxids.end(); it++) {