Skip to content
Bitcoin Roots

v29.4-roots.2 · Commit 3: [PATCH 03/21] 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. The two line-number columns refer to before and after.

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