Skip to content

Commit

Permalink
chain: minor.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Sep 7, 2017
1 parent f63c19c commit fdca08b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2640,18 +2640,17 @@ Chain.prototype.getLocks = async function getLocks(prev, tx, view, flags) {
Chain.prototype.verifyLocks = async function verifyLocks(prev, tx, view, flags) {
const [height, time] = await this.getLocks(prev, tx, view, flags);

// Also catches case where
// height is `-1`. Fall through.
if (height >= prev.height + 1)
return false;
if (height !== -1) {
if (height >= prev.height + 1)
return false;
}

if (time === -1)
return true;
if (time !== -1) {
const mtp = await this.getMedianTime(prev);

const mtp = await this.getMedianTime(prev);

if (time >= mtp)
return false;
if (time >= mtp)
return false;
}

return true;
};
Expand Down

0 comments on commit fdca08b

Please sign in to comment.