paypro: comment for handling 0-amount outputs from server.

This commit is contained in:
Christopher Jeffrey 2014-08-06 23:02:31 -07:00 committed by Manuel Araoz
parent d4f4f99dce
commit d58bfe9de8
1 changed files with 7 additions and 1 deletions

View File

@ -62,13 +62,19 @@ angular.module('copayApp.controllers').controller('SendController',
var w = $rootScope.wallet;
function done(ntxid, merchantData) {
// If user is granted the privilege of choosing
// their own amount, add it to the tx.
if (merchantData && +merchantData.total === 0) {
var txp = w.txProposals.get(ntxid);
txp.builder.tx.outs[0].v = bitcore.Bignum(amount + '', 10).toBuffer({
var tx = txp.builder.tx = txp.builder.tx || txp.builder.build();
tx.outs[0].v = bitcore.Bignum(amount + '', 10).toBuffer({
// XXX This may not work in node due
// to the bignum only-big endian bug:
endian: 'little',
size: 1
});
}
if (w.isShared()) {
$scope.loading = false;
var message = 'The transaction proposal has been created';