Fixes proposals with multiple outputs with only one output

This commit is contained in:
Gustavo Maximiliano Cortez 2015-12-16 16:15:40 -03:00
commit 8882ca8e87
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF

View file

@ -24,8 +24,8 @@ angular.module('copayApp.services').factory('txFormatService', function(profileS
root.processTx = function(tx) {
if (!tx) return;
var outputs = tx.outputs ? tx.outputs.length : 0;
if (outputs > 1 && tx.action != 'received') {
var outputs = lodash.isArray(tx.outputs) ? tx.outputs.length : 0;
if (outputs && tx.action != 'received') {
tx.hasMultiplesOutputs = true;
tx.recipientCount = outputs;
tx.amount = lodash.reduce(tx.outputs, function(total, o) {