From c6893991c322d3d89aee188901bdce8da264308b Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr <markbeamerjr@gmail.com>
Date: Mon, 14 May 2018 21:28:14 -0400
Subject: [PATCH 1/2] -removed comma on last column of query. -removed useless
 console log. -added more understandable logging for which claims are pushed
 to elastic search.

---
 server/utils/chainquery/index.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/server/utils/chainquery/index.js b/server/utils/chainquery/index.js
index 181d535..2bed624 100644
--- a/server/utils/chainquery/index.js
+++ b/server/utils/chainquery/index.js
@@ -59,7 +59,6 @@ export async function claimSync () {
           weight: 30,
         };
       }
-      console.log('Push claim to elastic search: ' + claim);
       pushElastic(claim);
     }
     winston.log('info', '[Importer] Removing blocked claims from search!');
@@ -97,7 +96,7 @@ export function getStats () {
 }
 
 async function pushElastic (claim) {
-  console.log('_id:' + claim.claimId);
+  console.log('Pushing To Elastic Search claimId:' + claim.claimId);
   return new Promise(async(resolve, reject) => {
     queue.push({
       index: 'claims',
@@ -155,7 +154,7 @@ function getClaimsSince (time) {
         `value_as_json as value, ` +
         `bid_state, ` +
         `effective_amount, ` +
-        `claim_id as claimId, ` +
+        `claim_id as claimId ` +
         // `transaction_by_hash_id, ` + // txhash and vout needed to leverage old format for comparison.
         // `vout ` +
       `FROM claim ` +
-- 
2.49.1


From 4e1808c58505e296331a1c69e15ff9998e4cab36 Mon Sep 17 00:00:00 2001
From: Mark Beamer Jr <markbeamerjr@gmail.com>
Date: Tue, 15 May 2018 00:03:07 -0400
Subject: [PATCH 2/2] -fixed util import for chainquery sync -added https for
 blocked files api -added comma to commented section so query is intact if
 uncommented.

---
 server/utils/chainquery/index.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/utils/chainquery/index.js b/server/utils/chainquery/index.js
index 2bed624..91ee49f 100644
--- a/server/utils/chainquery/index.js
+++ b/server/utils/chainquery/index.js
@@ -11,6 +11,7 @@ import rp from 'request-promise';
 import appRoot from 'app-root-path';
 import fs from 'fs';
 import fileExists from 'file-exists';
+import * as util from '../../utils/importer/util';
 
 const loggerStream = winstonStream(winston, 'info');
 const eclient = new elasticsearch.Client({
@@ -61,8 +62,8 @@ export async function claimSync () {
       }
       pushElastic(claim);
     }
+    winston.log('info', '[Importer] Pushed ' + claims.length + ' claims to elastic search');
     winston.log('info', '[Importer] Removing blocked claims from search!');
-    let util = require('./util.js');
     let blockedOutputsResponse = await getBlockedOutpoints();
     let outpointlist = JSON.parse(blockedOutputsResponse);
     for (let outpoint of outpointlist.data.outpoints) {
@@ -136,7 +137,7 @@ function sleep (ms) {
 
 function getBlockedOutpoints () {
   return new Promise((resolve, reject) => {
-    rp(`http://api.lbry.io/file/list_blocked`)
+    rp(`https://api.lbry.io/file/list_blocked`)
       .then(function (htmlString) {
         resolve(htmlString);
       })
@@ -155,7 +156,7 @@ function getClaimsSince (time) {
         `bid_state, ` +
         `effective_amount, ` +
         `claim_id as claimId ` +
-        // `transaction_by_hash_id, ` + // txhash and vout needed to leverage old format for comparison.
+        // `,transaction_by_hash_id, ` + // txhash and vout needed to leverage old format for comparison.
         // `vout ` +
       `FROM claim ` +
       `WHERE modified >='` + time + `'`;
-- 
2.49.1