fix findLocator.

This commit is contained in:
Christopher Jeffrey 2016-06-03 12:02:07 -07:00
parent b9434afc1e
commit 496b922f18
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

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