Fixed join wallet from remote peer
This commit is contained in:
parent
493f5c3427
commit
c98323e9d3
4 changed files with 12 additions and 12 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
function Passphrase(config) {
|
||||
config = config || {};
|
||||
this.salt = config.storageSalt;
|
||||
this.salt = config.storageSalt || 'mjuBtGybi/4=';
|
||||
this.iterations = config.iterations || 1000;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ WalletFactory.prototype.remove = function(walletId) {
|
|||
};
|
||||
|
||||
|
||||
WalletFactory.prototype.joinCreateSession = function(secret, nickname, cb) {
|
||||
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, cb) {
|
||||
var self = this;
|
||||
|
||||
var s;
|
||||
|
|
@ -162,7 +162,7 @@ WalletFactory.prototype.joinCreateSession = function(secret, nickname, cb) {
|
|||
} catch (e) {
|
||||
return cb('badSecret');
|
||||
}
|
||||
|
||||
|
||||
//Create our PrivateK
|
||||
var privateKey = new PrivateKey({ networkName: this.networkName });
|
||||
this.log('\t### PrivateKey Initialized');
|
||||
|
|
@ -180,6 +180,7 @@ WalletFactory.prototype.joinCreateSession = function(secret, nickname, cb) {
|
|||
if (data.type ==='walletId') {
|
||||
data.opts.privateKey = privateKey;
|
||||
data.opts.nickname = nickname;
|
||||
data.opts.passphrase = passphrase;
|
||||
var w = self.open(data.walletId, data.opts);
|
||||
w.firstCopayerId = s.pubKey;
|
||||
return cb(null, w);
|
||||
|
|
|
|||
|
|
@ -47,9 +47,11 @@ Storage.prototype._read = function(k) {
|
|||
var ret;
|
||||
try {
|
||||
ret = localStorage.getItem(k);
|
||||
ret = this._decrypt(ret);
|
||||
ret = ret.toString(CryptoJS.enc.Utf8);
|
||||
ret = JSON.parse(ret);
|
||||
if (ret){
|
||||
ret = this._decrypt(ret);
|
||||
ret = ret.toString(CryptoJS.enc.Utf8);
|
||||
ret = JSON.parse(ret);
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Error while decrypting: '+e);
|
||||
throw e;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue