'If auto_connect and lagging, switch interface'

def switch_lagging_interface(self):

    if (self.server_is_lagging() and self.auto_connect):
        header = self.blockchain().read_header(self.get_local_height())
        filtered = map((lambda x: x[0]), filter((lambda x: (x[1].tip_header == header)), self.interfaces.items()))
        if filtered:
            choice = random.choice(filtered)
            self.switch_to_interface(choice)
