diff --git a/src/policy/policy.h b/src/policy/policy.h index f62f9a86402..944d65d0c50 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -55,7 +55,7 @@ static const unsigned int MAX_STANDARD_SCRIPTSIG_SIZE = 1650; * standard and should be done with care and ideally rarely. It makes sense to * only increase the dust limit after prior releases were already not creating * outputs below the new threshold */ -static const unsigned int DUST_RELAY_TX_FEE = 3000; +static const unsigned int DUST_RELAY_TX_FEE = 100; /** * Standard script verification flags that standard transactions will comply * with. However scripts violating these flags may still be present in valid @@ -89,6 +89,9 @@ static constexpr unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCR static constexpr unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_VERIFY_SEQUENCE | LOCKTIME_MEDIAN_TIME_PAST; +// ELEMENTS: keep a copy of the upstream default dust relay fee rate +static const unsigned int DUST_RELAY_TX_FEE_BITCOIN = 3000; + CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee); bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 16b92acef39..68e0048dc63 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -795,6 +795,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) CheckIsStandard(t); // Check dust with default relay fee: + dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE_BITCOIN); // ELEMENTS: use the Bitcoin default dust relay feerate CAmount nDustThreshold = 182 * dustRelayFee.GetFeePerK() / 1000; BOOST_CHECK_EQUAL(nDustThreshold, 546); // dust: @@ -830,7 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) // not dust: t.vout[0].nValue = 674; CheckIsStandard(t); - dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE); + dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE_BITCOIN); // ELEMENTS: use the Bitcoin default dust relay feerate t.vout[0].scriptPubKey = CScript() << OP_1; CheckIsNotStandard(t, "scriptpubkey"); diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py index fdc23b507f1..560cc9f9fa3 100755 --- a/test/functional/mempool_accept.py +++ b/test/functional/mempool_accept.py @@ -46,6 +46,7 @@ def set_test_params(self): '-txindex', '-txindex','-permitbaremultisig=0', '-multi_data_permitted=1', # Elements test + '-dustrelayfee=0.00003000', # ELEMENTS: use the Bitcoin default dust relay fee rate ]] * self.num_nodes self.supports_cli = False