Skip to content

Commit

Permalink
Merge pull request #156 from kilpatty/node-http-reset-enforce
Browse files Browse the repository at this point in the history
http: add check for height being below tip
  • Loading branch information
boymanjor authored May 19, 2019
2 parents 956924b + 2a5933f commit 4db8f9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/node/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ class HTTP extends Server {
const height = valid.u32('height');

enforce(height != null, 'Height is required.');
enforce(height <= this.chain.height,
'Height cannot be greater than chain tip.');

await this.chain.reset(height);

Expand Down

0 comments on commit 4db8f9c

Please sign in to comment.