Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_anchors.py
Show All 22 Lines | def run_test(self): | ||||
node_anchors_path = os.path.join( | node_anchors_path = os.path.join( | ||||
self.nodes[0].datadir, "regtest", "anchors.dat" | self.nodes[0].datadir, "regtest", "anchors.dat" | ||||
) | ) | ||||
self.log.info("When node starts, check if anchors.dat doesn't exist") | self.log.info("When node starts, check if anchors.dat doesn't exist") | ||||
assert not os.path.exists(node_anchors_path) | assert not os.path.exists(node_anchors_path) | ||||
self.log.info( | self.log.info( | ||||
f"Add {BLOCK_RELAY_CONNECTIONS} block-relay-only connections to node") | f"Add {BLOCK_RELAY_CONNECTIONS} block-relay-only connections to node" | ||||
) | |||||
for i in range(BLOCK_RELAY_CONNECTIONS): | for i in range(BLOCK_RELAY_CONNECTIONS): | ||||
self.log.debug(f"block-relay-only: {i}") | self.log.debug(f"block-relay-only: {i}") | ||||
self.nodes[0].add_outbound_p2p_connection( | self.nodes[0].add_outbound_p2p_connection( | ||||
P2PInterface(), p2p_idx=i, connection_type="block-relay-only" | P2PInterface(), p2p_idx=i, connection_type="block-relay-only" | ||||
) | ) | ||||
self.log.info(f"Add {INBOUND_CONNECTIONS} inbound connections to node") | self.log.info(f"Add {INBOUND_CONNECTIONS} inbound connections to node") | ||||
for i in range(INBOUND_CONNECTIONS): | for i in range(INBOUND_CONNECTIONS): | ||||
Show All 31 Lines | def run_test(self): | ||||
assert ip_port in anchors | assert ip_port in anchors | ||||
for port in inbound_nodes_port: | for port in inbound_nodes_port: | ||||
ip_port = ip + port | ip_port = ip + port | ||||
assert ip_port not in anchors | assert ip_port not in anchors | ||||
self.log.info("Start node") | self.log.info("Start node") | ||||
self.start_node(0) | self.start_node(0) | ||||
self.log.info( | self.log.info("When node starts, check if anchors.dat doesn't exist anymore") | ||||
"When node starts, check if anchors.dat doesn't exist anymore") | |||||
assert not os.path.exists(node_anchors_path) | assert not os.path.exists(node_anchors_path) | ||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
AnchorsTest().main() | AnchorsTest().main() |