Changed constant used in calculating most applicable coin to use in a transaction, from COIN to DUST_SOFT_LIMIT

This commit is contained in:
Ross Nicoll 2014-04-12 22:51:24 +01:00
parent b08bfd12b4
commit f5fc30c2b5
No known key found for this signature in database
GPG key ID: 9142E5F7E533CE3B

View file

@ -1263,13 +1263,13 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT
int64_t nBest;
ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, 1000);
if (nBest != nTargetValue && nTotalLower >= nTargetValue + COIN)
ApproximateBestSubset(vValue, nTotalLower, nTargetValue + COIN, vfBest, nBest, 1000);
if (nBest != nTargetValue && nTotalLower >= nTargetValue + DUST_SOFT_LIMIT)
ApproximateBestSubset(vValue, nTotalLower, nTargetValue + DUST_SOFT_LIMIT, vfBest, nBest, 1000);
// If we have a bigger coin and (either the stochastic approximation didn't find a good solution,
// or the next bigger coin is closer), return the bigger coin
if (coinLowestLarger.second.first &&
((nBest != nTargetValue && nBest < nTargetValue + COIN) || coinLowestLarger.first <= nBest))
((nBest != nTargetValue && nBest < nTargetValue + DUST_SOFT_LIMIT) || coinLowestLarger.first <= nBest))
{
setCoinsRet.insert(coinLowestLarger.second);
nValueRet += coinLowestLarger.first;