aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/mininode.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-03-22 13:10:36 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-03-22 13:10:40 -0400
commit68520597ccf8ff3f6e8a7ad6869b06bf2012ae8a (patch)
tree82f1e98eb1d1eb29f780756642cd2bc8336dc45c /test/functional/test_framework/mininode.py
parentabd914ed34f12a5e7773e87e0457b04bcb7d58c4 (diff)
parentfab0a68aa25191a532f26cf8e227f456b853d8f1 (diff)
Merge #15631: qa: mininode: Clearer error message on invalid magic bytes
fab0a68aa2 qa: mininode: Clearer error message on invalid magic bytes (MarcoFalke) Pull request description: Old message: ``` ValueError: got garbage b'\xfa\xbf\xb5\xdafeefilter\x00\x00\x00\x08\x00\x00\x00\xe8\x0f\xd1\x9f\xe8\x03\x00\x00\x00\x00\x00\x00' ``` New message: ``` ValueError: magic bytes mismatch: b'\x00\x11"2' != b'\xfa\xbf\xb5\xdapong\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x97\xe6\x04\xd2\xff\x00\x00\x00\x00\x00\x00\x00' ``` ACKs for commit fab0a6: laanwj: Much better message, utACK fab0a68aa25191a532f26cf8e227f456b853d8f1 Tree-SHA512: 55854ef93d79c4f3219440e367fbcdf5db7b54c6530db0087fa8f8d9e786dac713f05da6f6c4c3cf29e18d07b4472f96a8ed894d66318e08cf8f208252199b70
Diffstat (limited to 'test/functional/test_framework/mininode.py')
-rwxr-xr-xtest/functional/test_framework/mininode.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py
index 52a840941b..7a063ac526 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]