Skip to content

Commit b63f7ab

Browse files
authored
Merge pull request ElementsProject#1433 from kilrau/reduce-default-dust-relay-fee
feat: reduce default dust relay fee
2 parents abbc170 + 32390d1 commit b63f7ab

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/policy/policy.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const unsigned int MAX_STANDARD_SCRIPTSIG_SIZE = 1650;
5555
* standard and should be done with care and ideally rarely. It makes sense to
5656
* only increase the dust limit after prior releases were already not creating
5757
* outputs below the new threshold */
58-
static const unsigned int DUST_RELAY_TX_FEE = 3000;
58+
static const unsigned int DUST_RELAY_TX_FEE = 100;
5959
/**
6060
* Standard script verification flags that standard transactions will comply
6161
* 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
8989
static constexpr unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_VERIFY_SEQUENCE |
9090
LOCKTIME_MEDIAN_TIME_PAST;
9191

92+
// ELEMENTS: keep a copy of the upstream default dust relay fee rate
93+
static const unsigned int DUST_RELAY_TX_FEE_BITCOIN = 3000;
94+
9295
CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee);
9396

9497
bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee);

src/test/transaction_tests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
795795
CheckIsStandard(t);
796796

797797
// Check dust with default relay fee:
798+
dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE_BITCOIN); // ELEMENTS: use the Bitcoin default dust relay feerate
798799
CAmount nDustThreshold = 182 * dustRelayFee.GetFeePerK() / 1000;
799800
BOOST_CHECK_EQUAL(nDustThreshold, 546);
800801
// dust:
@@ -830,7 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
830831
// not dust:
831832
t.vout[0].nValue = 674;
832833
CheckIsStandard(t);
833-
dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE);
834+
dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE_BITCOIN); // ELEMENTS: use the Bitcoin default dust relay feerate
834835

835836
t.vout[0].scriptPubKey = CScript() << OP_1;
836837
CheckIsNotStandard(t, "scriptpubkey");

test/functional/mempool_accept.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def set_test_params(self):
4646
'-txindex',
4747
'-txindex','-permitbaremultisig=0',
4848
'-multi_data_permitted=1', # Elements test
49+
'-dustrelayfee=0.00003000', # ELEMENTS: use the Bitcoin default dust relay fee rate
4950
]] * self.num_nodes
5051
self.supports_cli = False
5152

0 commit comments

Comments
 (0)