async def send_bytes_and_drain(self, msg: bytes) -> None:
        """Should be used when possible (in async scope), to avoid memory exhaustion."""
        async with self.drain_write_lock:
            self.send_bytes(msg)
            await self.writer.drain()
Should be used when possible (in async scope), to avoid memory exhaustion.
electrum/lntransport.py