diff --git a/js/controllers/create.js b/js/controllers/create.js index 341ca9f6a..52db78e95 100644 --- a/js/controllers/create.js +++ b/js/controllers/create.js @@ -84,6 +84,7 @@ angular.module('copayApp.controllers').controller('CreateController', nickname: $scope.myNickname, passphrase: passphrase, privateKeyHex: $scope.private, + networkName: $scope.networkName, }; var w = walletFactory.create(opts); controllerUtils.startNetwork(w, $scope); diff --git a/js/models/core/WalletFactory.js b/js/models/core/WalletFactory.js index 482b57c37..9f0945b45 100644 --- a/js/models/core/WalletFactory.js +++ b/js/models/core/WalletFactory.js @@ -26,7 +26,6 @@ var StorageLocalEncrypted = module.exports.StorageLocalEncrypted = require('../s * @param {Object} config.network - the configuration to be sent to the Network constructor * @param {Blockchain} config.Blockchain - the class to instantiate to get information about the blockchain (Insight by default) * @param {Object} config.blockchain - the configuration to be sent to the Blockchain constructor - * @param {string} config.networkName - the name of the bitcoin network to use ('testnet' or 'livenet') * @TODO: Investigate what parameters go inside this object * @param {Object} config.wallet - default configuration for the wallet * @TODO: put `version` inside of the config object @@ -92,7 +91,6 @@ WalletFactory.prototype.fromObj = function(obj, skipFields) { var w = Wallet.fromObj(obj, this.storage, this.network, this.blockchain); if (!w) return false; this._checkVersion(w.version); - this._checkNetwork(w.getNetworkName()); return w; }; @@ -241,17 +239,6 @@ WalletFactory.prototype._checkVersion = function(inVersion) { } }; -/** - * @desc Throw an error if the network name is different to {@link WalletFactory#networkName} - * @param {string} inNetworkName - the network name to check - * @throws {Error} - */ -WalletFactory.prototype._checkNetwork = function(inNetworkName) { - if (this.networkName !== inNetworkName) { - throw new Error('This Wallet is configured for ' + inNetworkName + ' while currently Copay is configured for: ' + this.networkName + '. Check your settings.'); - } -}; - /** * @desc Retrieve a wallet from the storage * @param {string} walletId - the id of the wallet