This commit is contained in:
Manuel Araoz 2014-06-02 18:59:38 -03:00
parent 55245650bd
commit 1cba837f8d
1 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ WalletFactory.prototype._checkRead = function(walletId) {
s.get(walletId, 'txProposals') && s.get(walletId, 'txProposals') &&
s.get(walletId, 'opts') && s.get(walletId, 'opts') &&
s.get(walletId, 'privateKey'); s.get(walletId, 'privateKey');
return ret; return !!ret;
}; };
WalletFactory.prototype.fromObj = function(obj) { WalletFactory.prototype.fromObj = function(obj) {
@ -57,15 +57,15 @@ WalletFactory.prototype.fromObj = function(obj) {
WalletFactory.prototype.fromEncryptedObj = function(base64, password) { WalletFactory.prototype.fromEncryptedObj = function(base64, password) {
this.storage._setPassphrase(password); this.storage._setPassphrase(password);
var walletObj = this.storage.import(base64); var walletObj = this.storage.import(base64);
if (!walletObj) return null; if (!walletObj) return false;
var w = this.fromObj(walletObj); var w = this.fromObj(walletObj);
if (!w) return null; if (!w) return false;
return w; return w;
}; };
WalletFactory.prototype.read = function(walletId) { WalletFactory.prototype.read = function(walletId) {
if (! this._checkRead(walletId)) if (! this._checkRead(walletId))
return null; return false;
var obj = {}; var obj = {};
var s = this.storage; var s = this.storage;