chaindb: do not use asyncobject.
This commit is contained in:
parent
f2ab1611e4
commit
a0d2cc598c
@ -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();
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user