Skip to content

Commit 4db8f9c

Browse files
authored
Merge pull request #156 from kilpatty/node-http-reset-enforce
http: add check for height being below tip
2 parents 956924b + 2a5933f commit 4db8f9c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/node/http.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ class HTTP extends Server {
385385
const height = valid.u32('height');
386386

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

389391
await this.chain.reset(height);
390392

0 commit comments

Comments
 (0)