def ban_peer(self, peer_obj): ip = peer_obj.peer_ip ban_time = ntp.getTime() + (config.user.ban_minutes * 60) banned_peers = self._get_banned_peers() banned_peers[ip] = ban_time self._update_banned_peers(banned_peers) logger.warning('Banned %s', peer_obj.peer_ip) peer_obj.loseConnection()
def ban_peer(self, peer_obj): # FIXME: Move to another class. Group peer banning there ip = peer_obj.peer_ip ban_time = ntp.getTime() + (config.user.ban_minutes * 60) banned_peers = self._get_banned_peers() banned_peers[ip] = ban_time self._update_banned_peers(banned_peers) logger.warning('Banned %s', peer_obj.peer_ip) peer_obj.loseConnection()
def ban_peer(self, peer_obj): self._banned_peers.add(peer_obj.addr_remote) logger.warning('Banned %s', peer_obj.addr_remote) peer_obj.loseConnection()