add dust check instead of higher fees

This commit is contained in:
Michel van Kessel
2020-11-22 20:52:48 +01:00
parent 8561778bc0
commit ab6828fc89
2 changed files with 14 additions and 3 deletions

View File

@@ -1240,6 +1240,17 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
AssertLockHeld(cs_main); AssertLockHeld(cs_main);
if (pfMissingInputs) if (pfMissingInputs)
*pfMissingInputs = false; *pfMissingInputs = false;
int dust_tx_count = 0;
CAmount min_dust = 100000;
BOOST_FOREACH (const CTxOut& txout, tx.vout) {
// LogPrintf("tx_out value %d, minimum value %d dust count %d", txout.nValue, min_dust, dust_tx_count);
if (txout.nValue < min_dust)
dust_tx_count = dust_tx_count + 1;
if (dust_tx_count > 10)
return state.DoS(0, false, REJECT_DUST, "too many dust vouts");
}
if (!CheckTransaction(tx, state)) if (!CheckTransaction(tx, state))
return false; // state filled in by CheckTransaction return false; // state filled in by CheckTransaction

View File

@@ -43,11 +43,11 @@ extern bool fWalletUnlockStakingOnly;
static const unsigned int DEFAULT_KEYPOOL_SIZE = 100; static const unsigned int DEFAULT_KEYPOOL_SIZE = 100;
//! -paytxfee default //! -paytxfee default
static const CAmount DEFAULT_TRANSACTION_FEE = 100000; static const CAmount DEFAULT_TRANSACTION_FEE = 10000;
//! -fallbackfee default //! -fallbackfee default
static const CAmount DEFAULT_FALLBACK_FEE = 100000; static const CAmount DEFAULT_FALLBACK_FEE = 10000;
//! -mintxfee default //! -mintxfee default
static const CAmount DEFAULT_TRANSACTION_MINFEE = 100000; static const CAmount DEFAULT_TRANSACTION_MINFEE = 10000;
//! minimum change amount //! minimum change amount
static const CAmount MIN_CHANGE = CENT; static const CAmount MIN_CHANGE = CENT;
//! Default for -spendzeroconfchange //! Default for -spendzeroconfchange