add m to export

This commit is contained in:
Matias Alejo Garcia 2015-02-17 14:55:57 -03:00
parent 705773aa37
commit 9d226effe9
1 changed files with 6 additions and 7 deletions

View File

@ -154,7 +154,6 @@ API.prototype.createWallet = function(walletName, copayerName, m, n, network, cb
if (data)
return cb('Storage already contains a wallet');
console.log('[API.js.132]'); //TODO
// Generate wallet key pair to verify copayers
var privKey = new Bitcore.PrivateKey(null, network);
var pubKey = privKey.toPublicKey();
@ -223,7 +222,7 @@ API.prototype._joinWallet = function(data, secret, copayerName, cb) {
var wallet = body.wallet;
data.copayerId = body.copayerId;
data.walletPrivKey = walletPrivKey.toWIF();
data.signingPrivKey = signingPrivKey.toString();
data.signingPrivKey = signingPrivKey.toWIF();
data.m = wallet.m;
data.n = wallet.n;
data.publicKeyRing = wallet.publicKeyRing;
@ -312,11 +311,11 @@ API.prototype.getBalance = function(cb) {
API.prototype.export = function(cb) {
var self = this;
this._loadAndCheck( function(err, data) {
if (err) return cb(err);
var x = _.pick(data,['publicKeyRing','xPrivKey', 'copayerId', 'signingPrivKey'])
return cb(null, JSON.stringify(x));
});
this._loadAndCheck(function(err, data) {
if (err) return cb(err);
var x = _.pick(data, ['publicKeyRing', 'xPrivKey', 'copayerId', 'm'])
return cb(null, JSON.stringify(x));
});
}
API.prototype.getTxProposals = function(opts, cb) {