Improved readability of sorting for coin selection.
authorMurch <alszacrel@web.de>
Fri, 29 Nov 2019 13:15:28 +0000 (15:15 +0200)
committerLaser9un <laser9un@gmail.com>
Fri, 29 Nov 2019 13:15:28 +0000 (15:15 +0200)
src/wallet.cpp

index 9140710..2455b27 100644 (file)
@@ -1888,7 +1888,8 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, unsigned int nSpendTime,
     }
 
     // Solve subset sum by stochastic approximation
-    sort(vValue.rbegin(), vValue.rend(), CompareValueOnly());
+    std::sort(vValue.begin(), vValue.end(), CompareValueOnly());
+    std::reverse(vValue.begin(), vValue.end());
     vector<char> vfBest;
     int64_t nBest;