mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Introduce -dustrelayfee
This commit is contained in:
@@ -2335,7 +2335,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
||||
}
|
||||
}
|
||||
|
||||
if (txout.IsDust(::minRelayTxFee))
|
||||
if (txout.IsDust(dustRelayFee))
|
||||
{
|
||||
if (recipient.fSubtractFeeFromAmount && nFeeRet > 0)
|
||||
{
|
||||
@@ -2413,16 +2413,16 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
||||
// We do not move dust-change to fees, because the sender would end up paying more than requested.
|
||||
// This would be against the purpose of the all-inclusive feature.
|
||||
// So instead we raise the change and deduct from the recipient.
|
||||
if (nSubtractFeeFromAmount > 0 && newTxOut.IsDust(::minRelayTxFee))
|
||||
if (nSubtractFeeFromAmount > 0 && newTxOut.IsDust(dustRelayFee))
|
||||
{
|
||||
CAmount nDust = newTxOut.GetDustThreshold(::minRelayTxFee) - newTxOut.nValue;
|
||||
CAmount nDust = newTxOut.GetDustThreshold(dustRelayFee) - newTxOut.nValue;
|
||||
newTxOut.nValue += nDust; // raise change until no more dust
|
||||
for (unsigned int i = 0; i < vecSend.size(); i++) // subtract from first recipient
|
||||
{
|
||||
if (vecSend[i].fSubtractFeeFromAmount)
|
||||
{
|
||||
txNew.vout[i].nValue -= nDust;
|
||||
if (txNew.vout[i].IsDust(::minRelayTxFee))
|
||||
if (txNew.vout[i].IsDust(dustRelayFee))
|
||||
{
|
||||
strFailReason = _("The transaction amount is too small to send after the fee has been deducted");
|
||||
return false;
|
||||
@@ -2434,7 +2434,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
||||
|
||||
// Never create dust outputs; if we would, just
|
||||
// add the dust to the fee.
|
||||
if (newTxOut.IsDust(::minRelayTxFee))
|
||||
if (newTxOut.IsDust(dustRelayFee))
|
||||
{
|
||||
nChangePosInOut = -1;
|
||||
nFeeRet += nChange;
|
||||
|
||||
Reference in New Issue
Block a user