Skip to content
Bitcoin Roots

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

test/functional/p2p_invalid_messages.py

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

File metadata
index 507393fb7074dbe992ecb539a3b9d11409241630..13079cc4e2716101dad0ac549f6784e7f9d40bfa 100755

Download original patch · Release notes

Diff rows 1–13 of 13. 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_messages.py CHANGED
@@ -307,6 +307,13 @@ class InvalidMessagesTest(BitcoinTestFramework):
307
307
  peer.send_message(msg_headers([blockheader]))
308
308
  peer.wait_for_disconnect()
309
309
 
310
+ self.log.info('Test same previous scenario but with a whitelisted (noban) outbound peer. '
311
+ 'It should log as misbehaving but not cause a disconnection')
312
+ self.restart_node(0, extra_args=["-whitelist=noban,out@127.0.0.1"])
313
+ ob_peer = self.nodes[0].add_outbound_p2p_connection(P2PInterface(), p2p_idx=5)
314
+ with self.nodes[0].assert_debug_log(['Misbehaving', 'header with invalid proof of work']):
315
+ ob_peer.send_and_ping(msg_headers([blockheader]))
316
+
310
317
  def test_noncontinuous_headers_msg(self):
311
318
  self.log.info("Test headers message with non-continuous headers sequence is logged as misbehaving")
312
319
  block_hashes = self.generate(self.nodes[0], 10)