Browse Source

add payproUrl to model

activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
8b4a946497
  1. 2
      lib/model/txproposal.js
  2. 2
      lib/server.js

2
lib/model/txproposal.js

@ -24,6 +24,7 @@ TxProposal.create = function(opts) {
x.toAddress = opts.toAddress; x.toAddress = opts.toAddress;
x.amount = opts.amount; x.amount = opts.amount;
x.message = opts.message; x.message = opts.message;
x.payProUrl = opts.payProUrl;
x.proposalSignature = opts.proposalSignature; x.proposalSignature = opts.proposalSignature;
x.changeAddress = opts.changeAddress; x.changeAddress = opts.changeAddress;
x.inputs = []; x.inputs = [];
@ -48,6 +49,7 @@ TxProposal.fromObj = function(obj) {
x.toAddress = obj.toAddress; x.toAddress = obj.toAddress;
x.amount = obj.amount; x.amount = obj.amount;
x.message = obj.message; x.message = obj.message;
x.payProUrl = obj.payProUrl;
x.proposalSignature = obj.proposalSignature; x.proposalSignature = obj.proposalSignature;
x.changeAddress = obj.changeAddress; x.changeAddress = obj.changeAddress;
x.inputs = obj.inputs; x.inputs = obj.inputs;

2
lib/server.js

@ -557,7 +557,7 @@ WalletService.prototype.createTx = function(opts, cb) {
if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete')); if (!wallet.isComplete()) return cb(new ClientError('Wallet is not complete'));
var copayer = wallet.getCopayer(self.copayerId); var copayer = wallet.getCopayer(self.copayerId);
var hash = WalletUtils.getProposalHash(opts.toAddress, opts.amount, opts.message); var hash = WalletUtils.getProposalHash(opts.toAddress, opts.amount, opts.message, opts.payProUrl);
if (!self._verifySignature(hash, opts.proposalSignature, copayer.requestPubKey)) if (!self._verifySignature(hash, opts.proposalSignature, copayer.requestPubKey))
return cb(new ClientError('Invalid proposal signature')); return cb(new ClientError('Invalid proposal signature'));

Loading…
Cancel
Save