chain: fix retarget.
This commit is contained in:
parent
4b85715ec2
commit
731e615b86
@ -1883,7 +1883,7 @@ Chain.prototype.getTarget = function getTarget(block, prev, ancestors) {
|
||||
|
||||
assert(first);
|
||||
|
||||
this.retarget(prev, first);
|
||||
return this.retarget(prev, first);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -2029,7 +2029,7 @@ Chain.prototype.getState = function getState(prev, id, callback) {
|
||||
if (stateCache[entry.hash] != null)
|
||||
return walkForward(stateCache[entry.hash]);
|
||||
|
||||
return entry.getMedianTimeAsync(function(err, medianTime) {
|
||||
entry.getMedianTimeAsync(function(err, medianTime) {
|
||||
if (err)
|
||||
return walk(err);
|
||||
|
||||
@ -2040,7 +2040,7 @@ Chain.prototype.getState = function getState(prev, id, callback) {
|
||||
|
||||
height = entry.height - period;
|
||||
|
||||
return entry.getAncestorByHeight(height, walk);
|
||||
entry.getAncestorByHeight(height, walk);
|
||||
});
|
||||
})(null, prev);
|
||||
|
||||
@ -2120,9 +2120,10 @@ Chain.prototype.getState = function getState(prev, id, callback) {
|
||||
case constants.thresholdStates.ACTIVE:
|
||||
stateCache[entry.hash] = state;
|
||||
return walkForward(state);
|
||||
default:
|
||||
assert(false, 'Bad state.');
|
||||
break;
|
||||
}
|
||||
|
||||
assert(false, 'Bad state.');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user