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:
parent
d02ef684c6
commit
ec5500bd8c
|
@ -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) */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue