From 57f8863bf964f1515dd5fa96bd4f93507ac9fcfd Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Fri, 13 Feb 2015 16:26:33 -0300 Subject: [PATCH] fix copayers verification --- lib/clilib.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/clilib.js b/lib/clilib.js index 463672f..9ac09e1 100644 --- a/lib/clilib.js +++ b/lib/clilib.js @@ -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;