diff options
| author | Chris Moore <[email protected]> | 2014-02-09 11:25:59 -0800 |
|---|---|---|
| committer | Chris Moore <[email protected]> | 2014-02-09 11:25:59 -0800 |
| commit | 895189820066c473a76d91fd262754089a0dcaed (patch) | |
| tree | 1f1f046ccaeaf0e19f3da310cd4d4dd05d216040 | |
| parent | Version Update for 1.5.1 (diff) | |
| download | discoin-895189820066c473a76d91fd262754089a0dcaed.tar.xz discoin-895189820066c473a76d91fd262754089a0dcaed.zip | |
Aim for whole coin change, not just cent change to avoid fees if possible.
| -rw-r--r-- | src/wallet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 604068ee7..22926a4a9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1074,7 +1074,7 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe nValueRet += coin.first; return true; } - else if (n < nTargetValue + CENT) + else if (n < nTargetValue + COIN) { vValue.push_back(coin); nTotalLower += n; @@ -1110,13 +1110,13 @@ bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfThe int64 nBest; ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, 1000); - if (nBest != nTargetValue && nTotalLower >= nTargetValue + CENT) - ApproximateBestSubset(vValue, nTotalLower, nTargetValue + CENT, vfBest, nBest, 1000); + if (nBest != nTargetValue && nTotalLower >= nTargetValue + COIN) + ApproximateBestSubset(vValue, nTotalLower, nTargetValue + COIN, 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 + CENT) || coinLowestLarger.first <= nBest)) + ((nBest != nTargetValue && nBest < nTargetValue + COIN) || coinLowestLarger.first <= nBest)) { setCoinsRet.insert(coinLowestLarger.second); nValueRet += coinLowestLarger.first; |