minor fixes.
This commit is contained in:
parent
a5945c1d98
commit
055e5665e3
@ -1458,7 +1458,7 @@ Chain.prototype.add = function add(block, callback, force) {
|
||||
|
||||
if (height > self.bestHeight) {
|
||||
self.bestHeight = height;
|
||||
self.network.height = height;
|
||||
self.network.updateHeight(height);
|
||||
}
|
||||
|
||||
// If previous block wasn't ever seen,
|
||||
@ -1475,7 +1475,7 @@ Chain.prototype.add = function add(block, callback, force) {
|
||||
// getblocks sync, making it an orphan).
|
||||
if (block.getCoinbaseHeight() > self.bestHeight) {
|
||||
self.bestHeight = block.getCoinbaseHeight();
|
||||
self.network.height = self.bestHeight;
|
||||
self.network.updateHeight(self.bestHeight);
|
||||
}
|
||||
|
||||
self.emit('orphan', block, {
|
||||
|
||||
@ -145,12 +145,12 @@ ldb.parseOptions = function parseOptions(options) {
|
||||
*/
|
||||
|
||||
ldb.destroy = function destroy(options, callback) {
|
||||
var backend = ldb.parseOptions(options).db;
|
||||
options = ldb.parseOptions(options);
|
||||
|
||||
if (!backend.destroy)
|
||||
if (!options.db.destroy)
|
||||
return utils.nextTick(callback);
|
||||
|
||||
backend.destroy(options.location, callback);
|
||||
options.db.destroy(options.location, callback);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -160,12 +160,12 @@ ldb.destroy = function destroy(options, callback) {
|
||||
*/
|
||||
|
||||
ldb.repair = function repair(options, callback) {
|
||||
var backend = ldb.parseOptions(options).db;
|
||||
options = ldb.parseOptions(options);
|
||||
|
||||
if (!backend.repair)
|
||||
if (!options.db.repair)
|
||||
return utils.asyncify(callback)(new Error('Cannot repair.'));
|
||||
|
||||
backend.repair(options.location, callback);
|
||||
options.db.repair(options.location, callback);
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user