Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251mock_tor.send_raw("250-Continuing\r\n")252mock_tor.send_raw("250 OK\r\n")254self.log.info("Test that Tor control disconnects on receiving MAX_LINE_COUNT + 1 lines.")255with self.expect_disconnect(True, mock_tor):256for _ in range(MAX_LINE_COUNT + 1):257mock_tor.send_raw("250-Continuing\r\n")259mock_tor.stop()261def test_reconnect_backoff(self):262self.log.info("Test that a connection closed by Tor is re-established with backoff")264mock_tor = MockTorControlServer(self.next_port(), manual_mode=True)265self.restart_with_mock(mock_tor)267with self.expect_disconnect(True, mock_tor):268# Reply before closing, like Tor does after a failed AUTHENTICATE269mock_tor.send_raw("515 Authentication failed\r\n")270mock_tor.conn.shutdown(socket.SHUT_WR)272mock_tor.stop()274def run_test(self):275self.test_basic()276self.test_partial_data()277self.test_pow_fallback()278self.test_oversized_line()279self.test_overmany_lines()280self.test_reconnect_backoff()283if __name__ == '__main__':284TorControlTest(__file__).main()
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.