From 89b69e5d0a77a1919d44623b9c03fac38bc94131 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Fri, 13 Jun 2014 11:47:22 -0300 Subject: [PATCH] Fixes: open wallet livenet in testnet mode and viceversa when importing a backup --- js/models/core/WalletFactory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/models/core/WalletFactory.js b/js/models/core/WalletFactory.js index 1984b8333..6c00cc96a 100644 --- a/js/models/core/WalletFactory.js +++ b/js/models/core/WalletFactory.js @@ -53,7 +53,10 @@ WalletFactory.prototype.fromObj = function(obj) { obj.opts.reconnectDelay = this.walletDefaults.reconnectDelay; var w = Wallet.fromObj(obj, this.storage, this.network, this.blockchain); + if (!w) return false; w.verbose = this.verbose; + this._checkVersion(w.version); + this._checkNetwork(w.getNetworkName()); return w; }; @@ -62,7 +65,6 @@ WalletFactory.prototype.fromEncryptedObj = function(base64, password) { var walletObj = this.storage.import(base64); if (!walletObj) return false; var w = this.fromObj(walletObj); - if (!w) return false; return w; }; @@ -165,8 +167,6 @@ WalletFactory.prototype.open = function(walletId, opts) { var w = this.read(walletId); if (w) { - this._checkVersion(w.version); - this._checkNetwork(w.getNetworkName()); w.store(); } return w;