Skip to content

Commit fab0a68

Browse files
author
MarcoFalke
committed
qa: mininode: Clearer error message on invalid magic bytes
1 parent 81f732b commit fab0a68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/functional/test_framework/mininode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _on_data(self):
171171
if len(self.recvbuf) < 4:
172172
return
173173
if self.recvbuf[:4] != self.magic_bytes:
174-
raise ValueError("got garbage %s" % repr(self.recvbuf))
174+
raise ValueError("magic bytes mismatch: {} != {}".format(repr(self.magic_bytes), repr(self.recvbuf)))
175175
if len(self.recvbuf) < 4 + 12 + 4 + 4:
176176
return
177177
command = self.recvbuf[4:4+12].split(b"\x00", 1)[0]

0 commit comments

Comments
 (0)