diff --git a/lib/blockchain/chain.js b/lib/blockchain/chain.js index 572dc5427..89cdb1667 100644 --- a/lib/blockchain/chain.js +++ b/lib/blockchain/chain.js @@ -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(); }