# Buggy code
def __init__(
    self, my_peer, endpoint, network, metadata_store, settings=None, notifier=None
):
    super(RemoteQueryCommunity, self).__init__(my_peer, endpoint, network)

    self.notifier = notifier
    self.max_peers = 60

    self.settings = settings or RemoteQueryCommunitySettings()

    self.mds = metadata_store

    # This set contains all the peers that we queried for subscribed channels over time.
    # It is emptied regularly. The purpose of this set is to work as a filter so we never query the same
    # peer twice. If we do, this should happen realy rarely
    # TODO: use Bloom filter here instead. We actually *want* it to be all-false-positives eventually.
    self.queried_subscribed_channels_peers = set()
    self.queried_peers_limit = 1000

    if self.notifier:
        self.notifier.add_observer(
            NTFY.POPULARITY_COMMUNITY_ADD_UNKNOWN_TORRENT,
            self.on_pc_add_unknown_torrent,
        )

    self.add_message_handler(RemoteSelectPayload, self.on_remote_select)
    self.add_message_handler(SelectResponsePayload, self.on_remote_select_response)

    self.request_cache = RequestCache()


# Traceback (tribler_gui.event_request_manager.CoreConnectTimeoutError)
Traceback (most recent call last):
File "tribler_gui/event_request_manager.py", line 138, in <lambda>
File "tribler_gui/event_request_manager.py", line 80, in on_error
tribler_gui.event_request_manager.CoreConnectTimeoutError: Could not connect with the Tribler Core within 60 seconds
[PID:2608] 2020-10-23 14:44:34,910 - ERROR <taskmanager:135> RemoteQueryCommunity.done_cb(): Task resulted in error: get_entries_query() got an unexpected keyword argument 'infohash'
Traceback (most recent call last):
File "ipv8/taskmanager.py", line 131, in done_cb
File "tribler_core/modules/metadata_store/community/remote_query_community.py", line 124, in on_remote_select
File "tribler_core/modules/metadata_store/orm_bindings/metadata_node.py", line 140, in get_entries_threaded
File "concurrent/futures/thread.py", line 57, in run
File "tribler_core/modules/metadata_store/orm_bindings/metadata_node.py", line 135, in _get_results
File "<string>", line 2, in get_entries
File "pony/orm/core.py", line 528, in new_func
File "tribler_core/modules/metadata_store/orm_bindings/metadata_node.py", line 150, in get_entries
TypeError: get_entries_query() got an unexpected keyword argument 'infohash'

# Fixed code
def __init__(
    self, my_peer, endpoint, network, metadata_store, settings=None, notifier=None
):
    super(RemoteQueryCommunity, self).__init__(my_peer, endpoint, network)

    self.notifier = notifier
    self.max_peers = 60

    self.settings = settings or RemoteQueryCommunitySettings()

    self.mds = metadata_store

    # This set contains all the peers that we queried for subscribed channels over time.
    # It is emptied regularly. The purpose of this set is to work as a filter so we never query the same
    # peer twice. If we do, this should happen realy rarely
    # TODO: use Bloom filter here instead. We actually *want* it to be all-false-positives eventually.
    self.queried_subscribed_channels_peers = set()
    self.queried_peers_limit = 1000

    if self.notifier:
        self.notifier.add_observer(
            NTFY.POPULARITY_COMMUNITY_ADD_UNKNOWN_TORRENT,
            self.on_pc_add_unknown_torrent,
        )

    # this flag enable or disable https://github.com/Tribler/tribler/pull/5657
    # it can be changed in runtime
    self.enable_resolve_unknown_torrents_feature = False
    self.add_message_handler(RemoteSelectPayload, self.on_remote_select)
    self.add_message_handler(SelectResponsePayload, self.on_remote_select_response)

    self.request_cache = RequestCache()