Skip to content

Commit a782042

Browse files
committed
qa: Treat mininode p2p exceptions as fatal
1 parent ce82985 commit a782042

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/functional/test_framework/mininode.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,7 @@ def deliver(self, conn, message):
15021502
except:
15031503
print("ERROR delivering %s (%s)" % (repr(message),
15041504
sys.exc_info()[0]))
1505+
raise
15051506

15061507
def get_deliver_sleep_time(self):
15071508
with mininode_lock:
@@ -1701,13 +1702,10 @@ def handle_close(self):
17011702
self.cb.on_close(self)
17021703

17031704
def handle_read(self):
1704-
try:
1705-
t = self.recv(8192)
1706-
if len(t) > 0:
1707-
self.recvbuf += t
1708-
self.got_data()
1709-
except:
1710-
pass
1705+
t = self.recv(8192)
1706+
if len(t) > 0:
1707+
self.recvbuf += t
1708+
self.got_data()
17111709

17121710
def readable(self):
17131711
return True
@@ -1773,8 +1771,10 @@ def got_data(self):
17731771
self.got_message(t)
17741772
else:
17751773
logger.warning("Received unknown command from %s:%d: '%s' %s" % (self.dstaddr, self.dstport, command, repr(msg)))
1774+
raise ValueError("Unknown command: '%s'" % (command))
17761775
except Exception as e:
17771776
logger.exception('got_data:', repr(e))
1777+
raise
17781778

17791779
def send_message(self, message, pushbuf=False):
17801780
if self.state != "connected" and not pushbuf:

0 commit comments

Comments
 (0)