def ban(self, peer, message_type):
        if message_type == 100:
            reason = "RECONNECTIONS"
        elif message_type == 110:
            reason = "MALFORMATTED"
        else:
            reason = Command.Name(message_type)
        self.log.warning("Banned %s. Reason: too many %s messages." %
                         (peer[0], reason))
        self.multiplexer.ban_ip(peer[0])
        if peer in self.multiplexer:
            self.multiplexer[peer].shutdown()
        reactor.callLater(self.ban_time, self.multiplexer.remove_ip_ban, peer[0])
dataset/ETHPy150Open OpenBazaar/OpenBazaar-Server/net/dos.py/BanScore.ban/original