fix state cache optimization.

This commit is contained in:
Christopher Jeffrey 2016-06-06 16:56:28 -07:00
parent c97551ba1f
commit ea4e4b888d
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -2201,7 +2201,7 @@ Chain.prototype.getState = function getState(prev, id, callback) {
if (!entry)
return walkForward(constants.thresholdStates.DEFINED);
if (self.stateCache[entry.hash])
if (self.stateCache[entry.hash] != null)
return walkForward(self.stateCache[entry.hash]);
return entry.getMedianTimeAsync(function(err, medianTime) {