|
|
@ -391,7 +391,7 @@ WalletService.prototype._addCopayerToWallet = function(wallet, opts, cb) { |
|
|
|
|
|
|
|
WalletService.prototype._addKeyToCopayer = function(wallet, copayer, opts, cb) { |
|
|
|
var self = this; |
|
|
|
wallet.addCopayerRequestKey(copayer.copayerId, opts.requestPubKey, opts.signature, opts.restrictions); |
|
|
|
wallet.addCopayerRequestKey(copayer.copayerId, opts.requestPubKey, opts.signature, opts.restrictions, opts.name); |
|
|
|
self.storage.storeWalletAndUpdateCopayersLookup(wallet, function(err) { |
|
|
|
if (err) return cb(err); |
|
|
|
|
|
|
@ -412,6 +412,7 @@ WalletService.prototype._addKeyToCopayer = function(wallet, copayer, opts, cb) { |
|
|
|
* @param {string} opts.restrictions |
|
|
|
* - cannotProposeTXs |
|
|
|
* - cannotXXX TODO |
|
|
|
* @param {string} opts.name (name for the new access) |
|
|
|
*/ |
|
|
|
WalletService.prototype.addAccess = function(opts, cb) { |
|
|
|
var self = this; |
|
|
@ -429,7 +430,8 @@ WalletService.prototype.addAccess = function(opts, cb) { |
|
|
|
var xPubKey = _.find(wallet.copayers, { |
|
|
|
id: opts.copayerId |
|
|
|
}).xPubKey; |
|
|
|
if (!WalletUtils.checkRequestPubKey(opts.requestPubKey, opts.signature, xPubKey)) { |
|
|
|
|
|
|
|
if (!WalletUtils.verifyRequestPubKey(opts.requestPubKey, opts.signature, xPubKey)) { |
|
|
|
return cb(Errors.NOT_AUTHORIZED); |
|
|
|
} |
|
|
|
|
|
|
|