def METHOD_NAME(stub, accounts):
    block_count = stub.GetLedgerInfo(Empty()).block_count
    synced = {a: False for a in accounts}
    while not any(synced.values()):
        logging.info("Waiting for accounts to sync")
        for a in synced:
            request = mobilecoind_api_pb2.GetMonitorStatusRequest(monitor_id=a)
            monitor_block = stub.GetMonitorStatus(request).status.next_block
            if monitor_block == block_count:
                synced[a] = True
    return {a for a in synced if synced[a] == True}