chaindb: do not use asyncobject.
This commit is contained in:
parent
f2ab1611e4
commit
a0d2cc598c
@ -8,7 +8,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var AsyncObject = require('../utils/asyncobject');
|
|
||||||
var util = require('../utils/util');
|
var util = require('../utils/util');
|
||||||
var BufferReader = require('../utils/reader');
|
var BufferReader = require('../utils/reader');
|
||||||
var StaticWriter = require('../utils/staticwriter');
|
var StaticWriter = require('../utils/staticwriter');
|
||||||
@ -51,8 +50,6 @@ function ChainDB(chain) {
|
|||||||
if (!(this instanceof ChainDB))
|
if (!(this instanceof ChainDB))
|
||||||
return new ChainDB(chain);
|
return new ChainDB(chain);
|
||||||
|
|
||||||
AsyncObject.call(this);
|
|
||||||
|
|
||||||
this.chain = chain;
|
this.chain = chain;
|
||||||
this.options = chain.options;
|
this.options = chain.options;
|
||||||
this.network = this.options.network;
|
this.network = this.options.network;
|
||||||
@ -69,8 +66,6 @@ function ChainDB(chain) {
|
|||||||
this.cacheHeight = new LRU(this.options.entryCache);
|
this.cacheHeight = new LRU(this.options.entryCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
util.inherits(ChainDB, AsyncObject);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database layout.
|
* Database layout.
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
@ -81,11 +76,10 @@ ChainDB.layout = layout;
|
|||||||
/**
|
/**
|
||||||
* Open the chain db, wait for the database to load.
|
* Open the chain db, wait for the database to load.
|
||||||
* @method
|
* @method
|
||||||
* @alias ChainDB#open
|
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ChainDB.prototype._open = co(function* open() {
|
ChainDB.prototype.open = co(function* open() {
|
||||||
var state;
|
var state;
|
||||||
|
|
||||||
this.logger.info('Opening ChainDB...');
|
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.
|
* Close the chain db, wait for the database to close.
|
||||||
* @alias ChainDB#close
|
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ChainDB.prototype._close = function close() {
|
ChainDB.prototype.close = function close() {
|
||||||
return this.db.close();
|
return this.db.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user