diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py index dcb93e9acce..4ababe01dc1 100755 --- a/test/functional/test_framework/p2p.py +++ b/test/functional/test_framework/p2p.py @@ -82,6 +82,7 @@ from test_framework.util import ( ) from test_framework.v2_p2p import ( EncryptedP2PState, + MSGTYPE_TO_SHORTID, SHORTID, ) @@ -386,15 +387,25 @@ class P2PConnection(asyncio.Protocol): """Build a serialized P2P message""" msgtype = message.msgtype data = message.serialize() - tmsg = self.magic_bytes - tmsg += msgtype - tmsg += b"\x00" * (12 - len(msgtype)) - tmsg += struct.pack("