Skip to content

Commit

Permalink
Merge pull request #7046 from kozlovsky/cherrypick_ipv8_endpoint_fix
Browse files Browse the repository at this point in the history
Fix initialization of Ipv8Endpoint in RESTComponent
  • Loading branch information
kozlovsky authored Sep 9, 2022
2 parents 77fa948 + 48ba8c0 commit 839229e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tribler/core/components/restapi/restapi_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ async def run(self):
metadata_store_component.mds)
self.maybe_add('/tags', TagsEndpoint, db=tag_component.tags_db, community=tag_component.community)

ipv8_root_endpoint = IPV8RootEndpoint()
for _, endpoint in ipv8_root_endpoint.endpoints.items():
endpoint.initialize(ipv8_component.ipv8)
self.root_endpoint.add_endpoint('/ipv8', ipv8_root_endpoint)
if not isinstance(ipv8_component, NoneComponent):
ipv8_root_endpoint = IPV8RootEndpoint()
for _, endpoint in ipv8_root_endpoint.endpoints.items():
endpoint.initialize(ipv8_component.ipv8)
self.root_endpoint.add_endpoint('/ipv8', ipv8_root_endpoint)

# Note: AIOHTTP endpoints cannot be added after the app has been started!
rest_manager = RESTManager(config=config.api, root_endpoint=self.root_endpoint, state_dir=config.state_dir)
Expand Down

0 comments on commit 839229e

Please sign in to comment.