Skip to content

Commit

Permalink
crash when block is not available locally
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs committed Jun 24, 2024
1 parent fd992d0 commit 9fc8be6
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,16 +464,7 @@ module.exports = class Autobase extends ReadyResource {
this._prebump = this._openPreBump()
await this._prebump

try {
await this._catchup(this._initialHeads)
} catch (err) {
safetyCatch(err)

this._initialHeads = []
await this._updateBootRecordHeads(this.system.heads)

this._warn(err)
}
await this._catchup(this._initialHeads)

await this._wakeup.ready()

Expand Down Expand Up @@ -519,9 +510,7 @@ module.exports = class Autobase extends ReadyResource {
// we should have all nodes locally
const block = await w.writer.core.get(length - 1, { wait: false })

if (block === null) {
throw new Error('Catchup failed: local block not available')
}
assert(block !== null, 'Catchup failed: local block not available')

for (const dep of block.node.heads) {
nodes.push(dep)
Expand Down

0 comments on commit 9fc8be6

Please sign in to comment.