def cb():
            self.chopExcessLinks_dcall = None
            osm = self.main.osm

            # Keep a set of unwanted outbound neighbors.  We will remove
            # wanted neighbors from this set, and kill what remains.
            unwanted = set(pn.ipp for pn in self.pnbs.itervalues()
                           if pn.outbound)
            n_alive = 0

            for n in osm.nodes:
                try:
                    pn = self.pnbs[n.ipp]
                    if not pn.outbound:
                        raise KeyError
                except KeyError:
                    # We ran out of nodes before hitting the target number
                    # of strongly connected nodes.  That means stuff's still
                    # connecting, and there's no need to remove anyone.
                    unwanted.clear()
                    break

                # This neighbor is NOT unwanted.
                unwanted.remove(pn.ipp)

                # Stop once we reach the desired number of outbound links.
                if pn.stronglyConnected():
                    n_alive += 1
                    if n_alive == self.OUTLINK_GOAL:
                        break

            # If any unwanted links remain, remove them.
            for ipp in unwanted:
                CHECK(self.removeOutboundLink(ipp))