mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
qa: Treat mininode p2p exceptions as fatal
This commit is contained in:
parent
7ddd169212
commit
8855f4b97d
@ -1536,6 +1536,7 @@ class NodeConnCB(object):
|
|||||||
except:
|
except:
|
||||||
print("ERROR delivering %s (%s)" % (repr(message),
|
print("ERROR delivering %s (%s)" % (repr(message),
|
||||||
sys.exc_info()[0]))
|
sys.exc_info()[0]))
|
||||||
|
raise
|
||||||
|
|
||||||
def set_deliver_sleep_time(self, value):
|
def set_deliver_sleep_time(self, value):
|
||||||
with mininode_lock:
|
with mininode_lock:
|
||||||
@ -1744,13 +1745,10 @@ class NodeConn(asyncore.dispatcher):
|
|||||||
self.cb.on_close(self)
|
self.cb.on_close(self)
|
||||||
|
|
||||||
def handle_read(self):
|
def handle_read(self):
|
||||||
try:
|
|
||||||
t = self.recv(8192)
|
t = self.recv(8192)
|
||||||
if len(t) > 0:
|
if len(t) > 0:
|
||||||
self.recvbuf += t
|
self.recvbuf += t
|
||||||
self.got_data()
|
self.got_data()
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def readable(self):
|
def readable(self):
|
||||||
return True
|
return True
|
||||||
@ -1816,8 +1814,10 @@ class NodeConn(asyncore.dispatcher):
|
|||||||
self.got_message(t)
|
self.got_message(t)
|
||||||
else:
|
else:
|
||||||
logger.warning("Received unknown command from %s:%d: '%s' %s" % (self.dstaddr, self.dstport, str(command), repr(msg)))
|
logger.warning("Received unknown command from %s:%d: '%s' %s" % (self.dstaddr, self.dstport, str(command), repr(msg)))
|
||||||
|
raise ValueError("Unknown command: '%s'" % (command))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception('got_data:', repr(e))
|
logger.exception('got_data:', repr(e))
|
||||||
|
raise
|
||||||
|
|
||||||
def send_message(self, message, pushbuf=False):
|
def send_message(self, message, pushbuf=False):
|
||||||
if self.state != "connected" and not pushbuf:
|
if self.state != "connected" and not pushbuf:
|
||||||
|
Loading…
Reference in New Issue
Block a user