[wallet] Refactor to use new MIN_CHANGE

* Introduce new constant MIN_CHANGE and use it instead of the
hardcoded "CENT"
* Add test case for MIN_CHANGE
* Introduce new constant for -mintxfee default:
  DEFAULT_TRANSACTION_MINFEE = 1000
This commit is contained in:
MarcoFalke
2015-09-13 23:23:59 +02:00
parent 0143a1f228
commit 6b0e622c25
4 changed files with 84 additions and 55 deletions

View File

@@ -567,7 +567,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
nChange -= nPayFee;
// Never create dust outputs; if we would, just add the dust to the fee.
if (nChange > 0 && nChange < CENT)
if (nChange > 0 && nChange < MIN_CHANGE)
{
CTxOut txout(nChange, (CScript)std::vector<unsigned char>(24, 0));
if (txout.IsDust(::minRelayTxFee))