Skip to content

Commit

Permalink
test: pass dustrelayfee=0 option for tests using dust (instead of `…
Browse files Browse the repository at this point in the history
…acceptnonstdtxn=1`)

By specifying the `dustrelayfee=0` option instead of the more
generic `acceptnonstdtxn=1`, we can be more specific about what
part of the transaction is non-standard and can be sure that all
other aspects follow the standard policy.
  • Loading branch information
theStack committed Jul 3, 2022
1 parent 4129c13 commit 1770be7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions test/functional/feature_dbcrash.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def set_test_params(self):
self.node2_args = ["-dbcrashratio=24", "-dbcache=16"] + self.base_args

# Node3 is a normal node with default args, except will mine full blocks
# and non-standard txs (e.g. txs with "dust" outputs)
self.node3_args = ["-blockmaxweight=4000000", "-acceptnonstdtxn"]
# and txs with "dust" outputs
self.node3_args = ["-blockmaxweight=4000000", "-dustrelayfee=0"]
self.extra_args = [self.node0_args, self.node1_args, self.node2_args, self.node3_args]

def setup_network(self):
Expand Down Expand Up @@ -211,7 +211,9 @@ def run_test(self):
self.crashed_on_restart = 0 # Track count of crashes during recovery

# Start by creating a lot of utxos on node3
utxo_list = self.wallet.send_self_transfer_multi(from_node=self.nodes[3], num_outputs=5000)['new_utxos']
utxo_list = []
for _ in range(5):
utxo_list.extend(self.wallet.send_self_transfer_multi(from_node=self.nodes[3], num_outputs=1000)['new_utxos'])
self.generate(self.nodes[3], 1, sync_fun=self.no_op)
assert_equal(len(self.nodes[3].getrawmempool()), 0)
self.log.info(f"Prepped {len(utxo_list)} utxo entries")
Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WalletTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.extra_args = [[
"-acceptnonstdtxn=1", "-walletrejectlongchains=0"
"-dustrelayfee=0", "-walletrejectlongchains=0"
]] * self.num_nodes
self.setup_clean_chain = True
self.supports_cli = False
Expand Down

0 comments on commit 1770be7

Please sign in to comment.