Skip to content
Bitcoin Roots

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

test/functional/p2p_invalid_tx.py

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

File metadata
index 439735d178a3f841949a0e0bac7c8d583a7724f0..6f64b4f04cffbd3dbace20b7e27f81c982ba3dc6 100755

Download original patch · Release notes

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

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.

test/functional/p2p_invalid_tx.py CHANGED
@@ -33,8 +33,8 @@ class InvalidTxRequestTest(BitcoinTestFramework):
33
  """Add a P2P connection to the node.
34
 
35
  Helper to connect and wait for version handshake."""
36
- for _ in range(num_connections):
37
- self.nodes[0].add_p2p_connection(P2PDataStore())
38
 
39
  def reconnect_p2p(self, **kwargs):
40
  """Tear down and bootstrap the P2P connection to the node.
@@ -186,6 +186,7 @@ class InvalidTxRequestTest(BitcoinTestFramework):
186
  self.log.info('Send the block that includes the previous orphan ... ')
187
  with node.assert_debug_log(["Erased 1 orphan transaction(s) included or conflicted by block"]):
188
  node.p2ps[0].send_blocks_and_test([block_A], node, success=True)
 
189
 
190
  self.log.info('Test that a transaction in the orphan pool conflicts with a new tip block causes erase this transaction from the orphan pool')
191
  tx_withhold_until_block_B = CTransaction()
@@ -215,6 +216,7 @@ class InvalidTxRequestTest(BitcoinTestFramework):
215
  self.log.info('Send the block that includes a transaction which conflicts with the previous orphan ... ')
216
  with node.assert_debug_log(["Erased 1 orphan transaction(s) included or conflicted by block"]):
217
  node.p2ps[0].send_blocks_and_test([block_B], node, success=True)
 
218
 
219
 
220
  if __name__ == '__main__':
 
33
  """Add a P2P connection to the node.
34
 
35
  Helper to connect and wait for version handshake."""
36
+ for i in range(num_connections):
37
+ self.nodes[0].add_outbound_p2p_connection(P2PDataStore(), p2p_idx=i)
38
 
39
  def reconnect_p2p(self, **kwargs):
40
  """Tear down and bootstrap the P2P connection to the node.
 
186
  self.log.info('Send the block that includes the previous orphan ... ')
187
  with node.assert_debug_log(["Erased 1 orphan transaction(s) included or conflicted by block"]):
188
  node.p2ps[0].send_blocks_and_test([block_A], node, success=True)
189
+ node.syncwithvalidationinterfacequeue()
190
 
191
  self.log.info('Test that a transaction in the orphan pool conflicts with a new tip block causes erase this transaction from the orphan pool')
192
  tx_withhold_until_block_B = CTransaction()
 
216
  self.log.info('Send the block that includes a transaction which conflicts with the previous orphan ... ')
217
  with node.assert_debug_log(["Erased 1 orphan transaction(s) included or conflicted by block"]):
218
  node.p2ps[0].send_blocks_and_test([block_B], node, success=True)
219
+ node.syncwithvalidationinterfacequeue()
220
 
221
 
222
  if __name__ == '__main__':