fix findLocator.
This commit is contained in:
parent
b9434afc1e
commit
496b922f18
@ -2104,11 +2104,8 @@ Chain.prototype.retarget = function retarget(prev, first) {
|
||||
Chain.prototype.findLocator = function findLocator(locator, callback) {
|
||||
var self = this;
|
||||
|
||||
if (!locator)
|
||||
return utils.nextTick(callback);
|
||||
|
||||
utils.forEachSerial(locator, function(hash, next) {
|
||||
self.db.has(hash, function(err, result) {
|
||||
self.db.isMainChain(hash, function(err, result) {
|
||||
if (err)
|
||||
return next(err);
|
||||
|
||||
@ -2117,7 +2114,12 @@ Chain.prototype.findLocator = function findLocator(locator, callback) {
|
||||
|
||||
next();
|
||||
});
|
||||
}, callback);
|
||||
}, function(err) {
|
||||
if (err)
|
||||
return callback(err);
|
||||
|
||||
return callback(null, self.network.genesis.hash);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user