From 9619779426eee5430166257017ba088d45e72d5a Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 16 Feb 2016 01:32:28 -0800 Subject: [PATCH] fix vars. --- lib/bcoin/blockdb.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/bcoin/blockdb.js b/lib/bcoin/blockdb.js index 636a5992..d219fb99 100644 --- a/lib/bcoin/blockdb.js +++ b/lib/bcoin/blockdb.js @@ -74,6 +74,8 @@ BlockDB.prototype.migrate = function migrate(blockSize, compression, callback) { if (compression != null) options.compression = compression; + options.maxOpenFiles = 60000; + utils.print('Migrating DB with options:'); utils.print(options); @@ -579,6 +581,8 @@ BlockDB.prototype.getCoin = function getCoin(hash, index, callback) { var id = 'u/t/' + hash + '/' + index; this.index.get(id, function(err, record) { + var record; + if (err) { if (err.type === 'NotFoundError') return callback(); @@ -661,8 +665,6 @@ BlockDB.prototype._getTXByAddress = function _getTXByAddress(address, callback) stream.on('data', function(data) { var parts = data.key.split('/').slice(3); var hash = parts[0]; - // Could store block hash in key - // var blockHash = parts[1]; var record = self.parseOffset(data.value); pending++; @@ -729,6 +731,8 @@ BlockDB.prototype.getTX = function getTX(hash, callback) { var id = 't/t/' + hash; this.index.get(id, function(err, record) { + var record; + if (err) { if (err.type === 'NotFoundError') return callback(); @@ -771,6 +775,8 @@ BlockDB.prototype.getBlock = function getBlock(hash, callback) { id = 'b/h/' + value; this.index.get(id, function(err, record) { + var record; + if (err) { if (err.type === 'NotFoundError') return callback();