From 34ac49b3b816018afc19583884b662cce905d532 Mon Sep 17 00:00:00 2001 From: joeuhren Date: Tue, 1 Oct 2019 19:31:28 -0600 Subject: [PATCH] fix error when syncing and last block height is < 1 --- lib/database.js | 1 + lib/markets/database.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/database.js b/lib/database.js index 75372f0..fe366b9 100644 --- a/lib/database.js +++ b/lib/database.js @@ -671,6 +671,7 @@ module.exports = { // updates tx, address & richlist db's; called by sync.js update_tx_db: function(coin, start, end, timeout, cb) { var complete = false; + if (start < 1) start = 1; // fix for invalid block height (skip genesis block as it should not have valid txs) lib.syncLoop((end - start) + 1, function (loop) { var x = loop.iteration(); if (x % 5000 === 0) { diff --git a/lib/markets/database.js b/lib/markets/database.js index 75372f0..fe366b9 100644 --- a/lib/markets/database.js +++ b/lib/markets/database.js @@ -671,6 +671,7 @@ module.exports = { // updates tx, address & richlist db's; called by sync.js update_tx_db: function(coin, start, end, timeout, cb) { var complete = false; + if (start < 1) start = 1; // fix for invalid block height (skip genesis block as it should not have valid txs) lib.syncLoop((end - start) + 1, function (loop) { var x = loop.iteration(); if (x % 5000 === 0) {