From 7dbbb79cecb5f9f06c9406eaa680e047f7024af6 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 16 Mar 2016 14:50:19 -0400 Subject: [PATCH] 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. --- src/rpcmisc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index e04b77d75..1a86353e2 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -464,7 +464,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 >::const_iterator it=vtxids.begin(); it!=vtxids.end(); it++) {