private void maintainRouteTable() throws IOException {
        long currentTime = System.currentTimeMillis();
        for (Bucket bucket : routeTable.buckets) {
            if (currentTime - bucket.lastChangeTime > 900000) {
                byte[] randomId = Util.randomId(bucket.min, bucket.max);
                findNodes(randomId);
            }
            for (Node node : bucket.nodes) {
                if (!((currentTime - node.lastReplyTime < 900000) || (node.replied && currentTime - node.lastReqTime < 900000))) {
                    pingNode(new Addr(node.ip, node.port), this.nodeId);
                    bucket.nodes.remove(node);
                }
            }
        }
        findNodes(this.nodeId);
    }