Browse Source

remove unused elements in output order array

activeAddress
Ivan Socolsky 9 years ago
parent
commit
6476de0461
  1. 7
      lib/model/txproposal.js
  2. 2
      test/integration/server.js

7
lib/model/txproposal.js

@ -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];
});
});

2
test/integration/server.js

@ -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 = [{

Loading…
Cancel
Save