From 96efcadfc0d8a84066982533c676072d3b5d8314 Mon Sep 17 00:00:00 2001 From: Murch Date: Mon, 7 Dec 2015 18:35:29 +0100 Subject: [PATCH] Improved readability of sorting for coin selection. Future proofing added lines --- src/wallet/wallet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d23d54e67..0e1425640 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1701,7 +1701,8 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int } // 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; CAmount nBest;