add options to enter Priv Key on join

This commit is contained in:
Matias Alejo Garcia 2014-08-20 18:00:33 -04:00
commit 2fbbd2a53a
3 changed files with 27 additions and 7 deletions

View file

@ -214,16 +214,22 @@ WalletFactory.prototype.decodeSecret = function(secret) {
}
};
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, cb) {
var self = this;
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, privateHex, cb) {
var self = this;
var s = self.decodeSecret(secret);
if (!s) return cb('badSecret');
var privOpts = {
networkName: this.networkName,
};
if (privateHex && privateHex.length>10) {
privOpts.extendedPrivateKeyString = privateHex;
}
//Create our PrivateK
var privateKey = new PrivateKey({
networkName: this.networkName
});
var privateKey = new PrivateKey(privOpts);
this.log('\t### PrivateKey Initialized');
var opts = {
copayerId: privateKey.getId(),