Skip to content

Commit

Permalink
chain: abort on compacttree failure
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Jun 7, 2022
1 parent ee5d45f commit 4a112da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2172,6 +2172,10 @@ class Chain extends AsyncEmitter {
await this.db.compactTree(entry);
await this.syncTree();
this.emit('tree compact end', entry.treeRoot, entry);
} catch(e) {
const error = new CriticalError(e.message);
this.emit('abort', error);
throw error;
} finally {
unlock();
}
Expand Down

0 comments on commit 4a112da

Please sign in to comment.