chaindb: do not use asyncobject.

This commit is contained in:
Christopher Jeffrey 2017-03-05 14:32:50 -08:00
parent f2ab1611e4
commit a0d2cc598c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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();
};