async def worker(work_queue: asyncio.Queue, results_queue: asyncio.Queue, flag):
    """Connects to a Lightning peer and checks whether the announced feature
    from the gossip is equal to the feature in the init message.

    Returns None if no connection could be made, True or False otherwise."""
    count = 0
    while not work_queue.empty():
        if count > NODES_PER_WORKER:
            return
        work = await work_queue.get()

        # only check non-onion addresses
        addr = None
        for a in work['addrs']:
            if "onion" not in a[0]:
                addr = a
        if not addr:
            await results_queue.put(None)
            continue

        # handle ipv4/ipv6
        if ':' in addr[0]:
            connect_str = f"{work['pk'].hex()}@[{addr.host}]:{addr.port}"
        else:
            connect_str = f"{work['pk'].hex()}@{addr.host}:{addr.port}"

        print(f"worker connecting to {connect_str}")
        try:
            peer = await wallet.lnworker.add_peer(connect_str)
            res = await util.wait_for2(peer.initialized, TIMEOUT)
            if res:
                if peer.features & flag == work['features'] & flag:
                    await results_queue.put(True)
                else:
                    await results_queue.put(False)
            else:
                await results_queue.put(None)
        except Exception as e:
            await results_queue.put(None)
Connects to a Lightning peer and checks whether the announced feature
    from the gossip is equal to the feature in the init message.

    Returns None if no connection could be made, True or False otherwise.
electrum/scripts/ln_features.py