diff --git a/lib/bcoin/chain.js b/lib/bcoin/chain.js index c0937331..308f6925 100644 --- a/lib/bcoin/chain.js +++ b/lib/bcoin/chain.js @@ -528,7 +528,8 @@ Chain.prototype.toJSON = function toJSON() { Chain.prototype.fromJSON = function fromJSON(json) { assert.equal(json.v, 1); assert.equal(json.type, 'chain'); - assert.equal(json.network, network.type); + if (json.network) + assert.equal(json.network, network.type); this.index.hashes = json.hashes.slice(); this.index.ts = json.ts.slice(); this.index.heights = json.heights.slice(); diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index 4b21ba97..dc4864aa 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -434,7 +434,8 @@ Wallet.prototype.toJSON = function toJSON() { Wallet.fromJSON = function fromJSON(json) { assert.equal(json.v, 1); assert.equal(json.type, 'wallet'); - assert.equal(json.network, network.type); + if (json.network) + assert.equal(json.network, network.type); var priv; var pub;