From fab0a68aa25191a532f26cf8e227f456b853d8f1 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Tue, 19 Mar 2019 17:15:59 -0400 Subject: [PATCH] qa: mininode: Clearer error message on invalid magic bytes --- test/functional/test_framework/mininode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index 52a840941..7a063ac52 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -171,7 +171,7 @@ class P2PConnection(asyncio.Protocol): if len(self.recvbuf) < 4: return if self.recvbuf[:4] != self.magic_bytes: - raise ValueError("got garbage %s" % repr(self.recvbuf)) + raise ValueError("magic bytes mismatch: {} != {}".format(repr(self.magic_bytes), repr(self.recvbuf))) if len(self.recvbuf) < 4 + 12 + 4 + 4: return command = self.recvbuf[4:4+12].split(b"\x00", 1)[0]