mirror of https://github.com/BTCPrivate/copay.git
Fix txp and tx with multiple and single outputs
This commit is contained in:
parent
c7bc2a16ba
commit
d125a14483
|
@ -501,6 +501,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
message: 'test multi-output',
|
||||
fee: 1000,
|
||||
createdOn: new Date() / 1000,
|
||||
type: 'multiple_output',
|
||||
outputs: []
|
||||
};
|
||||
function addOutput(n) {
|
||||
|
|
|
@ -24,9 +24,12 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
|
|||
root.processTx = function(tx) {
|
||||
if (!tx) return;
|
||||
|
||||
if (lodash.isArray(tx.outputs) && tx.outputs.length > 0 && tx.action != 'received') {
|
||||
tx.hasMultiplesOutputs = true;
|
||||
tx.recipientCount = tx.outputs.length;
|
||||
var outputs = lodash.isArray(tx.outputs) ? tx.outputs.length : 0;
|
||||
if (outputs && tx.action != 'received') {
|
||||
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) {
|
||||
o.amountStr = formatAmountStr(o.amount);
|
||||
o.alternativeAmountStr = formatAlternativeStr(o.amount);
|
||||
|
|
Loading…
Reference in New Issue