def METHOD_NAME(self, restart):
    # Repair all nodes
    for mn in self.mninfo:
        if self.check_banned(mn) or self.check_punished(mn):
            addr = self.nodes[0].getnewaddress()
            self.nodes[0].sendtoaddress(addr, 0.1)
            self.nodes[0].protx('update_service', mn.proTxHash, '127.0.0.1:%d' % p2p_port(mn.node.index), mn.keyOperator, "", addr)
            # Make sure this tx "safe" to mine even when InstantSend and ChainLocks are no longer functional
            self.bump_mocktime(60 * 10 + 1)
            self.nodes[0].generate(1)
            assert(not self.check_banned(mn))
            if restart:
                self.stop_node(mn.node.index)
                self.start_masternode(mn)
            else:
                mn.node.setnetworkactive(True)
        connect_nodes(mn.node, 0)
    self.sync_all()
    # Isolate and re-connect all MNs (otherwise there might be open connections with no MNAUTH for MNs which were banned before)
    for mn in self.mninfo:
        mn.node.setnetworkactive(False)
        wait_until(lambda: mn.node.getconnectioncount() == 0)
        mn.node.setnetworkactive(True)
        force_finish_mnsync(mn.node)
        connect_nodes(mn.node, 0)