Made it clearer how coins are chosen for use when making a transaction, by switching from COIN as constant

to DUST_SOFT_LIMIT.
This commit is contained in:
Ross Nicoll 2014-04-12 21:59:22 +01:00
parent d02ef684c6
commit ec5500bd8c
No known key found for this signature in database
GPG key ID: 9142E5F7E533CE3B
2 changed files with 3 additions and 2 deletions

View file

@ -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) */

View file

@ -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;
}