check for network on fromJSON.
This commit is contained in:
parent
57491aaadc
commit
ef1244442f
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user