diff --git a/src/main.h b/src/main.h index 666a1293c..155ad413d 100644 --- a/src/main.h +++ b/src/main.h @@ -59,7 +59,7 @@ static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB /** The pre-allocation chunk size for rev?????.dat files (since 0.8) */ static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB /** Dust Soft Limit, allowed with additional fee per output */ -static const int64_t DUST_SOFT_LIMIT = 100000000; +static const int64_t DUST_SOFT_LIMIT = COIN; /** Dust Hard Limit, ignored as wallet inputs (mininput default) */ static const int64_t DUST_HARD_LIMIT = 1000000; /** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */ diff --git a/src/wallet.cpp b/src/wallet.cpp index c6bb835e5..a4327f7b3 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1226,8 +1226,9 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT nValueRet += coin.first; return true; } - else if (n < nTargetValue + COIN) + else if (n < nTargetValue + DUST_SOFT_LIMIT) { + // Skip coins which, if used, would result in less than a transaction fee in change vValue.push_back(coin); nTotalLower += n; }