Skip to content
Bitcoin Roots

v29.4-roots.3 · Commit 3: [PATCH 03/30] policy: restore conservative relay and network controls

test/functional/mempool_datacarrier.py

Before: test/functional/mempool_datacarrier.py · After: test/functional/mempool_datacarrier.py

File metadata
index 48e636caa22211534ae48f8222d4ccc28749a209..c35b7acf5c32ebb29ae20de63a14bc50936f74b1 100755

Download original patch · Release notes

Diff rows 1–18 of 18. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

test/functional/mempool_datacarrier.py CHANGED
@@ -42,6 +42,7 @@ class DataCarrierTest(BitcoinTestFramework):
42
42
  assert tx.rehash() in node.getrawmempool(True), f'{tx_hex} not in mempool'
43
43
  else:
44
44
  assert_raises_rpc_error(-26, "scriptpubkey", self.wallet.sendrawtransaction, from_node=node, tx_hex=tx_hex)
45
+ return tx_hex
45
46
 
46
47
  def run_test(self):
47
48
  self.wallet = MiniWallet(self.nodes[0])
@@ -57,7 +58,10 @@ class DataCarrierTest(BitcoinTestFramework):
57
58
  self.test_null_data_transaction(node=self.nodes[0], data=default_size_data, success=True)
58
59
 
59
60
  self.log.info("Testing a null data transaction larger than allowed by the default -datacarriersize value.")
60
- self.test_null_data_transaction(node=self.nodes[0], data=too_long_data, success=False)
61
+ rejected_tx = self.test_null_data_transaction(node=self.nodes[0], data=too_long_data, success=False)
62
+ # Datacarrier limits are local relay policy. The same consensus-valid
63
+ # transaction must remain valid when supplied directly in a block.
64
+ self.generateblock(self.nodes[0], output="raw(42)", transactions=[rejected_tx], sync_fun=self.no_op)
61
65
 
62
66
  self.log.info("Testing a null data transaction with -datacarrier=false.")
63
67
  self.test_null_data_transaction(node=self.nodes[1], data=default_size_data, success=False)