hypercore 11.0.34 → 11.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -367,6 +367,9 @@ module.exports = class SessionState {
367
367
  if (this.prologue && length < this.prologue.length) {
368
368
  throw INVALID_OPERATION('Truncation breaks prologue')
369
369
  }
370
+ if (length > this.length) {
371
+ throw INVALID_OPERATION('Not a truncation, ' + length + ' must be less or equal to ' + this.length)
372
+ }
370
373
 
371
374
  const batch = this.createTreeBatch()
372
375
  await MerkleTree.truncate(this, length, batch, fork)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.0.34",
3
+ "version": "11.0.35",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {