[Pkg-bitcoin-commits] [bitcoin] 46/126: qa: Treat mininode p2p exceptions as fatal

Jonas Smedegaard dr at jones.dk
Mon Nov 13 20:01:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag debian/0.15.1_dfsg-1
in repository bitcoin.

commit 2f0b30a58a07a3e30faa82a27525025158754db2
Author: Suhas Daftuar <sdaftuar at chaincode.com>
Date:   Wed Sep 13 09:17:15 2017 -0400

    qa: Treat mininode p2p exceptions as fatal
    
    Github-Pull: #11319
    Rebased-From: a7820422e0b182db6f1df8904242e5d76d6c73fa
---
 test/functional/test_framework/mininode.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py
index 5924530..843b67c 100755
--- a/test/functional/test_framework/mininode.py
+++ b/test/functional/test_framework/mininode.py
@@ -1505,6 +1505,7 @@ class NodeConnCB(object):
             except:
                 print("ERROR delivering %s (%s)" % (repr(message),
                                                     sys.exc_info()[0]))
+                raise
 
     def set_deliver_sleep_time(self, value):
         with mininode_lock:
@@ -1708,13 +1709,10 @@ class NodeConn(asyncore.dispatcher):
         self.cb.on_close(self)
 
     def handle_read(self):
-        try:
-            t = self.recv(8192)
-            if len(t) > 0:
-                self.recvbuf += t
-                self.got_data()
-        except:
-            pass
+        t = self.recv(8192)
+        if len(t) > 0:
+            self.recvbuf += t
+            self.got_data()
 
     def readable(self):
         return True
@@ -1780,8 +1778,10 @@ class NodeConn(asyncore.dispatcher):
                     self.got_message(t)
                 else:
                     logger.warning("Received unknown command from %s:%d: '%s' %s" % (self.dstaddr, self.dstport, command, repr(msg)))
+                    raise ValueError("Unknown command: '%s'" % (command))
         except Exception as e:
             logger.exception('got_data:', repr(e))
+            raise
 
     def send_message(self, message, pushbuf=False):
         if self.state != "connected" and not pushbuf:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-bitcoin/bitcoin.git



More information about the Pkg-bitcoin-commits mailing list