From c080a629585f40332a684b06e2a5cd53916e6cb9 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Fri, 12 May 2017 16:23:17 -0400 Subject: [PATCH] Callback not called properly in _process for sync. --- lib/services/db/index.js | 2 +- lib/services/db/sync.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/services/db/index.js b/lib/services/db/index.js index b6cb3b54..03d9647e 100644 --- a/lib/services/db/index.js +++ b/lib/services/db/index.js @@ -157,7 +157,6 @@ DB.prototype.start = function(callback) { mkdirp.sync(this.dataPath); } - self.genesis = Block.fromBuffer(self.bitcoind.genesisBuffer); self._store = levelup(self.dataPath, { db: self.levelupStore, keyEncoding: 'binary', valueEncoding: 'binary'}); self.store = { @@ -170,6 +169,7 @@ DB.prototype.start = function(callback) { self.node.once('ready', function() { + self.genesis = Block.fromBuffer(self.bitcoind.genesisBuffer); self.loadTips(function(err) { if(err) { diff --git a/lib/services/db/sync.js b/lib/services/db/sync.js index c470fa07..b1137bb1 100644 --- a/lib/services/db/sync.js +++ b/lib/services/db/sync.js @@ -260,6 +260,7 @@ BlockStream.prototype._getBlocks = function(heights, callback) { } self.push(null); + callback(); }); };