From 4617a24bbe912962d5eb7918fc3d8a0a237aef74 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Thu, 1 May 2014 16:21:53 -0300 Subject: [PATCH] fixed passphrase setting when a existent wallet is opened --- js/models/core/WalletFactory.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/models/core/WalletFactory.js b/js/models/core/WalletFactory.js index 5e6708c38..a76446372 100644 --- a/js/models/core/WalletFactory.js +++ b/js/models/core/WalletFactory.js @@ -68,13 +68,12 @@ WalletFactory.prototype.fromObj = function(obj) { return w; }; -WalletFactory.prototype.read = function(walletId, passphrase) { +WalletFactory.prototype.read = function(walletId) { if (! this._checkRead(walletId)) return false; var obj = {}; var s = this.storage; - s._setPassphrase(passphrase); obj.id = walletId; obj.opts = s.get(walletId, 'opts'); @@ -128,12 +127,15 @@ WalletFactory.prototype.create = function(opts) { }; WalletFactory.prototype.open = function(walletId, opts) { - this.log('Opening walletId:' + walletId); opts = opts || {}; opts.id = walletId; opts.verbose = this.verbose; - var w = this.read(walletId, opts.passphrase) || this.create(opts); + + this.storage._setPassphrase(opts.passphrase); + + var w = this.read(walletId) || this.create(opts); w.store(); + return w; };