Fix txp and tx with multiple and single outputs
This commit is contained in:
parent
c7bc2a16ba
commit
d125a14483
2 changed files with 7 additions and 3 deletions
|
|
@ -501,6 +501,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
message: 'test multi-output',
|
message: 'test multi-output',
|
||||||
fee: 1000,
|
fee: 1000,
|
||||||
createdOn: new Date() / 1000,
|
createdOn: new Date() / 1000,
|
||||||
|
type: 'multiple_output',
|
||||||
outputs: []
|
outputs: []
|
||||||
};
|
};
|
||||||
function addOutput(n) {
|
function addOutput(n) {
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,12 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
|
||||||
root.processTx = function(tx) {
|
root.processTx = function(tx) {
|
||||||
if (!tx) return;
|
if (!tx) return;
|
||||||
|
|
||||||
if (lodash.isArray(tx.outputs) && tx.outputs.length > 0 && tx.action != 'received') {
|
var outputs = lodash.isArray(tx.outputs) ? tx.outputs.length : 0;
|
||||||
tx.hasMultiplesOutputs = true;
|
if (outputs && tx.action != 'received') {
|
||||||
tx.recipientCount = tx.outputs.length;
|
if ((tx.type && tx.type == 'multiple_output') || (tx.proposalType && tx.proposalType == 'multiple_output')) {
|
||||||
|
tx.hasMultiplesOutputs = true;
|
||||||
|
tx.recipientCount = outputs;
|
||||||
|
}
|
||||||
tx.amount = lodash.reduce(tx.outputs, function(total, o) {
|
tx.amount = lodash.reduce(tx.outputs, function(total, o) {
|
||||||
o.amountStr = formatAmountStr(o.amount);
|
o.amountStr = formatAmountStr(o.amount);
|
||||||
o.alternativeAmountStr = formatAlternativeStr(o.amount);
|
o.alternativeAmountStr = formatAlternativeStr(o.amount);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue