optimization for checkFinal.
This commit is contained in:
parent
d5c9c31534
commit
2189d79c47
@ -2384,6 +2384,10 @@ Chain.prototype.checkFinal = function checkFinal(prev, tx, flags, callback) {
|
||||
return callback(null, tx.isFinal(height, ts));
|
||||
}
|
||||
|
||||
// We can skip MTP if the locktime is height.
|
||||
if (tx.locktime < constants.LOCKTIME_THRESHOLD)
|
||||
return utils.asyncify(check)(null, -1);
|
||||
|
||||
if (flags & constants.flags.MEDIAN_TIME_PAST)
|
||||
return prev.getMedianTimeAsync(check);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user