FIFO coin selection wallet.cpp

This commit is contained in:
saizsassin 2018-05-19 11:46:33 +05:30 committed by GitHub
parent 235f78b0c1
commit 1a38b114bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2467,8 +2467,9 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
std::set<unsigned int> 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<COutput> vCoins;
vCoins.clear();
for(std::set<unsigned int>::iterator its = time.begin();its!=time.end();its++)