Changeset View
Changeset View
Standalone View
Standalone View
src/qt/coincontroldialog.cpp
Show First 20 Lines • Show All 552 Lines • ▼ Show 20 Lines | if (nQuantity > 0) { | ||||
} | } | ||||
// Never create dust outputs; if we would, just add the dust to the | // Never create dust outputs; if we would, just add the dust to the | ||||
// fee. | // fee. | ||||
if (nChange > Amount::zero() && nChange < MIN_CHANGE) { | if (nChange > Amount::zero() && nChange < MIN_CHANGE) { | ||||
CTxOut txout(nChange, | CTxOut txout(nChange, | ||||
static_cast<CScript>(std::vector<uint8_t>(24, 0))); | static_cast<CScript>(std::vector<uint8_t>(24, 0))); | ||||
if (IsDust(txout, model->node().getDustRelayFee())) { | if (IsDust(txout, model->node().getDustRelayFee())) { | ||||
// dust-change will be raised until no dust | |||||
if (CoinControlDialog::fSubtractFeeFromAmount) { | |||||
nChange = GetDustThreshold( | |||||
txout, model->node().getDustRelayFee()); | |||||
} else { | |||||
nPayFee += nChange; | nPayFee += nChange; | ||||
nChange = Amount::zero(); | nChange = Amount::zero(); | ||||
if (CoinControlDialog::fSubtractFeeFromAmount) { | |||||
// we didn't detect lack of change above | |||||
nBytes -= 34; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
if (nChange == Amount::zero() && | if (nChange == Amount::zero() && | ||||
!CoinControlDialog::fSubtractFeeFromAmount) { | !CoinControlDialog::fSubtractFeeFromAmount) { | ||||
nBytes -= 34; | nBytes -= 34; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 256 Lines • Show Last 20 Lines |