From a0d2cc598c1578c010f21a81eb003960386bdb2f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 5 Mar 2017 14:32:50 -0800 Subject: [PATCH] chaindb: do not use asyncobject. --- lib/blockchain/chaindb.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/blockchain/chaindb.js b/lib/blockchain/chaindb.js index af8f717e..a4749789 100644 --- a/lib/blockchain/chaindb.js +++ b/lib/blockchain/chaindb.js @@ -8,7 +8,6 @@ 'use strict'; var assert = require('assert'); -var AsyncObject = require('../utils/asyncobject'); var util = require('../utils/util'); var BufferReader = require('../utils/reader'); var StaticWriter = require('../utils/staticwriter'); @@ -51,8 +50,6 @@ function ChainDB(chain) { if (!(this instanceof ChainDB)) return new ChainDB(chain); - AsyncObject.call(this); - this.chain = chain; this.options = chain.options; this.network = this.options.network; @@ -69,8 +66,6 @@ function ChainDB(chain) { this.cacheHeight = new LRU(this.options.entryCache); } -util.inherits(ChainDB, AsyncObject); - /** * Database layout. * @type {Object} @@ -81,11 +76,10 @@ ChainDB.layout = layout; /** * Open the chain db, wait for the database to load. * @method - * @alias ChainDB#open * @returns {Promise} */ -ChainDB.prototype._open = co(function* open() { +ChainDB.prototype.open = co(function* open() { var state; this.logger.info('Opening ChainDB...'); @@ -129,11 +123,10 @@ ChainDB.prototype._open = co(function* open() { /** * Close the chain db, wait for the database to close. - * @alias ChainDB#close * @returns {Promise} */ -ChainDB.prototype._close = function close() { +ChainDB.prototype.close = function close() { return this.db.close(); };