Skip to content

Commit

Permalink
chain: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Apr 12, 2022
1 parent 80baf34 commit d656335
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,10 @@ class Chain extends AsyncEmitter {

this.setDeploymentState(state);

if (this.options.compactTree) {
if (this.options.spv)
throw new Error('Cannot compact tree in SPV mode.');

// Will call syncTree() after compaction.
await this.compactTree();
} else {
if (!this.options.spv)
if (!this.options.spv) {
if (this.options.compactTree)
await this.compactTree();
else
await this.syncTree();
}

Expand Down

0 comments on commit d656335

Please sign in to comment.