Skip to content

Commit

Permalink
test: Fix race in p2p_invalid_messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Feb 2, 2019
1 parent 2c0867a commit fac3a05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/p2p_invalid_messages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node responses to invalid network messages."""
Expand Down Expand Up @@ -143,6 +143,7 @@ def run_test(self):

def test_magic_bytes(self):
conn = self.nodes[0].add_p2p_connection(P2PDataStore())
conn._on_data = lambda: None # Need to ignore all incoming messages from now, since they come with "invalid" magic bytes
conn.magic_bytes = b'\x00\x11\x22\x32'
with self.nodes[0].assert_debug_log(['PROCESSMESSAGE: INVALID MESSAGESTART ping']):
conn.send_message(messages.msg_ping(nonce=0xff))
Expand Down Expand Up @@ -211,6 +212,5 @@ def _tweak_msg_data_size(self, message, wrong_size):
return raw_msg_with_wrong_size



if __name__ == '__main__':
InvalidMessagesTest().main()

0 comments on commit fac3a05

Please sign in to comment.