From 95df147bd16a1b3052f1a62f18a3ef880b0ad0ab Mon Sep 17 00:00:00 2001 From: Murch Date: Fri, 29 Nov 2019 15:15:28 +0200 Subject: [PATCH 1/1] Improved readability of sorting for coin selection. --- src/wallet.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 9140710..2455b27 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -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 vfBest; int64_t nBest; -- 1.7.1