remove unused elements in output order array
This commit is contained in:
parent
fa7e2ef6ce
commit
6476de0461
|
@ -194,9 +194,12 @@ TxProposal.prototype._buildTx = function() {
|
||||||
|
|
||||||
// Shuffle outputs for improved privacy
|
// Shuffle outputs for improved privacy
|
||||||
if (t.outputs.length > 1) {
|
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) {
|
t.sortOutputs(function(outputs) {
|
||||||
return _.map(self.outputOrder, function(i) {
|
return _.map(outputOrder, function(i) {
|
||||||
return outputs[i];
|
return outputs[i];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -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() {
|
helpers.stubUtxos(server, wallet, [1, 2], function() {
|
||||||
var max = 3 - (7560 / 1e8); // Fees for this tx at 100bits/kB = 7560 sat
|
var max = 3 - (7560 / 1e8); // Fees for this tx at 100bits/kB = 7560 sat
|
||||||
var outputs = [{
|
var outputs = [{
|
||||||
|
|
Loading…
Reference in New Issue