Skip to content

Commit f117fb0

Browse files
committed
Replace coroutine with async def in p2p_invalid_messages.py
1 parent ac61ec9 commit f117fb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_invalid_messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ def run_test(self):
145145
def test_magic_bytes(self):
146146
conn = self.nodes[0].add_p2p_connection(P2PDataStore())
147147

148-
def swap_magic_bytes():
148+
async def swap_magic_bytes():
149149
conn._on_data = lambda: None # Need to ignore all incoming messages from now, since they come with "invalid" magic bytes
150150
conn.magic_bytes = b'\x00\x11\x22\x32'
151151

152152
# Call .result() to block until the atomic swap is complete, otherwise
153153
# we might run into races later on
154-
asyncio.run_coroutine_threadsafe(asyncio.coroutine(swap_magic_bytes)(), NetworkThread.network_event_loop).result()
154+
asyncio.run_coroutine_threadsafe(swap_magic_bytes(), NetworkThread.network_event_loop).result()
155155

156156
with self.nodes[0].assert_debug_log(['PROCESSMESSAGE: INVALID MESSAGESTART ping']):
157157
conn.send_message(messages.msg_ping(nonce=0xff))

0 commit comments

Comments
 (0)