remove unused elements in output order array

This commit is contained in:
Ivan Socolsky 2015-11-16 17:59:48 -03:00
parent fa7e2ef6ce
commit 6476de0461
2 changed files with 6 additions and 3 deletions

View File

@ -194,9 +194,12 @@ TxProposal.prototype._buildTx = function() {
// Shuffle outputs for improved privacy
if (t.outputs.length > 1) {
$.checkState(t.outputs.length == self.outputOrder.length);
var outputOrder = _.reject(self.outputOrder, function(order) {
return order >= t.outputs.length;
});
$.checkState(t.outputs.length == outputOrder.length);
t.sortOutputs(function(outputs) {
return _.map(self.outputOrder, function(i) {
return _.map(outputOrder, function(i) {
return outputs[i];
});
});

View File

@ -2146,7 +2146,7 @@ describe('Wallet service', function() {
});
});
it.only('should support creating a multiple output tx with no change address', function(done) {
it('should support creating a multiple output tx with no change address', function(done) {
helpers.stubUtxos(server, wallet, [1, 2], function() {
var max = 3 - (7560 / 1e8); // Fees for this tx at 100bits/kB = 7560 sat
var outputs = [{