From caf26b77ab880ecce2ef1eae50cd863ec9d3a52b Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Tue, 17 Aug 2021 00:42:58 +0200 Subject: fixup p2p-acceptblock and mininode to test disconnects without partially backporting a new testframework. - Adds a condition to NodeConn that when asyncore calls handle_read without any data, this must be a disconnect and closes the socket - Adds a little loop in the p2p-acceptblock client that waits for the socket to be in a closed state - Makes expected disconnects non-optional in p2p-acceptblock - Syncs the test descriptions and outputs with reality --- qa/rpc-tests/test_framework/mininode.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qa/rpc-tests/test_framework/mininode.py') diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index 1520e6754..964e98a1c 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -1684,6 +1684,10 @@ class NodeConn(asyncore.dispatcher): if len(t) > 0: self.recvbuf += t self.got_data() + else: + self.show_debug_msg("MiniNode: Closing connection to %s:%d after peer disconnect..." + % (self.dstaddr, self.dstport)) + self.handle_close() except: pass -- cgit v1.2.3