|
|
@ -72,8 +72,6 @@ CliLib.prototype._loadAndCheck = function() { |
|
|
|
process.exit(1); |
|
|
|
} |
|
|
|
|
|
|
|
// TODO
|
|
|
|
delete data['verified']; |
|
|
|
if (data.verified == 'corrupt') { |
|
|
|
log.error('The wallet is tagged as corrupt. Some of the copayers cannot be verified to have known the wallet secret.'); |
|
|
|
process.exit(1); |
|
|
@ -143,10 +141,10 @@ CliLib.prototype._joinWallet = function(data, secret, copayerName, cb) { |
|
|
|
|
|
|
|
var secretSplit = secret.split(':'); |
|
|
|
var walletId = secretSplit[0]; |
|
|
|
var privKey = Bitcore.PrivateKey.fromString(secretSplit[1]); |
|
|
|
var walletPrivKey = Bitcore.PrivateKey.fromString(secretSplit[1]); |
|
|
|
|
|
|
|
var xPubKey = new Bitcore.HDPublicKey(data.xPrivKey); |
|
|
|
var xPubKeySignature = SignUtils.sign(xPubKey.toString(), privKey); |
|
|
|
var xPubKeySignature = SignUtils.sign(xPubKey.toString(), walletPrivKey); |
|
|
|
|
|
|
|
var signingPrivKey = (new Bitcore.HDPrivateKey(data.xPrivKey)).derive('m/1/0').privateKey; |
|
|
|
|
|
|
@ -171,6 +169,7 @@ CliLib.prototype._joinWallet = function(data, secret, copayerName, cb) { |
|
|
|
|
|
|
|
var wallet = body.wallet; |
|
|
|
data.copayerId = body.copayerId; |
|
|
|
data.walletPrivKey = walletPrivKey; |
|
|
|
data.signingPrivKey = signingPrivKey.toString(); |
|
|
|
data.m = wallet.m; |
|
|
|
data.n = wallet.n; |
|
|
|