diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index 29bf33fa5be..d5b1a90687e 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -179,7 +179,7 @@ class P2PConnection(asyncio.Protocol): raise IOError('Not connected') self._log_message("send", message) tmsg = self._build_message(message) - NetworkThread.network_event_loop.call_soon_threadsafe(lambda: self._transport and self._transport.write(tmsg)) + NetworkThread.network_event_loop.call_soon_threadsafe(lambda: self._transport and not self._transport.is_closing() and self._transport.write(tmsg)) # Class utility methods