From 1a38b114bb07931194f07c975d0a762cc7b07ca5 Mon Sep 17 00:00:00 2001 From: saizsassin <39055732+saizsassin@users.noreply.github.com> Date: Sat, 19 May 2018 11:46:33 +0530 Subject: [PATCH] FIFO coin selection wallet.cpp --- 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 a1be221c6..f970b8191 100755 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2467,8 +2467,9 @@ bool CWallet::SelectCoins(const std::vector& vAvailableCoins, const CAm std::set time; for(it=vCoinsTmp.begin();it!=vCoinsTmp.end();it++) time.insert(it->tx->nTimeReceived); //nTimeReceived is the received time of the UTXO - + //store UTXOs in vCoins in the ascending order of time + std::reverse(vCoinsTmp.begin(),vCoinsTmp.end()); std::vector vCoins; vCoins.clear(); for(std::set::iterator its = time.begin();its!=time.end();its++)