Ping up to @count new peers from @new_peers 
        that aren't already known to us.  If they
        respond, then add them to the peer set.

        Return the (list of peers added, the list of peers already known, list of peers ignored)

def add_new_peers( self, count, new_peers, current_peers, con=None, path=None, peer_table=None ):
        """
        Ping up to @count new peers from @new_peers 
        that aren't already known to us.  If they
        respond, then add them to the peer set.

        Return the (list of peers added, the list of peers already known, list of peers ignored)
        """

        if self.ping_timeout is None:
            self.ping_timeout = atlas_ping_timeout()
 
        if path is None:
            path = self.atlasdb_path

        # only handle a few peers for now
        cnt = 0
        i = 0
        added = []
        present = []
        filtered = []
        while i < len(new_peers) and cnt < min(count, len(new_peers)):
            peer = self.canonical_peer( new_peers[i] )
            i += 1

            if peer == self.my_hostport:
                filtered.append(peer)
                continue

            if peer in current_peers:
                log.debug("%s is already known" % peer)
                present.append(peer)
                continue 

            cnt += 1

            # test the peer before adding
            res = atlas_peer_getinfo( peer, timeout=self.ping_timeout, peer_table=peer_table )
            if res is None:
                # didn't respond successfully
                filtered.append(peer)
                continue

            if not res.has_key('server_version'):
                # too old.  TODO: ban them
                filtered.append(peer)
                continue

            if (BLOCKSTACK_PUBLIC_TESTNET and res['server_version'] != MIN_ATLAS_VERSION) or (not BLOCKSTACK_PUBLIC_TESTNET and semver_newer(res['server_version'], MIN_ATLAS_VERSION)):
                # mainnet: too old to be a valid atlas node for this network version
                # testnet: not the same version == don't connect
                filtered.append(peer)
                log.debug("%s is too old to be an atlas node (version %s)" % (peer, res['server_version']))

                # TODO: ban them
                continue
            
            # advance our consensus hashes
            our_last_block = get_last_block(self.working_dir)
            if not self.consensus_hashes.has_key(our_last_block):
                cur_last_block = max(self.consensus_hashes.keys())
                new_consensus_hashes = get_snapshots(self.working_dir, start_block=cur_last_block, end_block=our_last_block+1)
                self.consensus_hashes.update(new_consensus_hashes)

            if self.consensus_hashes.has_key(our_last_block):

                their_last_block = res['last_block_processed']
                if their_last_block <= our_last_block and res['consensus'] not in self.consensus_hashes.values():
                    # on different consensus rules than us
                    log.debug("Peer {} has ({},{}), but we have ({},{}). Ignoring.".format(peer, their_last_block, res['consensus'], our_last_block, self.consensus_hashes[our_last_block]))

                    # TODO: drop them from the peer table, and don't reconnect with them for a while.
                    continue

            if res:
                log.debug("Add newly-discovered peer %s" % peer)
                atlasdb_add_peer( peer, con=con, path=path, peer_table=peer_table )
                added.append(peer)
            else:
                filtered.append(peer)

        return added, present, filtered