MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / disconnect_p2ps

Method disconnect_p2ps

test/functional/test_framework/test_node.py:839–847  ·  view source on GitHub ↗

Close all p2p connections to the node. The state of the peers (such as txrequests) may not be fully cleared yet, even after this method returns.

(self)

Source from the content-addressed store, hash-verified

837 return len([peer for peer in self.getpeerinfo() if peer['subver'] == P2P_SUBVERSION])
838
839 def disconnect_p2ps(self):
840 """Close all p2p connections to the node.
841 The state of the peers (such as txrequests) may not be fully cleared
842 yet, even after this method returns."""
843 for p in self.p2ps:
844 p.peer_disconnect()
845 del self.p2ps[:]
846
847 self.wait_until(lambda: self.num_test_p2p_connections() == 0)
848
849 def is_connected_to(self, other):
850 assert isinstance(other, TestNode)

Callers 15

test_service_flagsMethod · 0.80
run_testMethod · 0.80
run_testMethod · 0.80
run_testMethod · 0.80
run_testMethod · 0.80
blocksonly_mode_testsMethod · 0.80
run_testMethod · 0.80

Calls 3

wait_untilMethod · 0.95
peer_disconnectMethod · 0.80

Tested by

no test coverage detected