Browse Source

Optionally disable outputs shuffling for createTx

activeAddress
Kosta Korenkov 9 years ago
parent
commit
11b32f4ee5
  1. 5
      lib/model/txproposal.js
  2. 1
      lib/server.js

5
lib/model/txproposal.js

@ -36,7 +36,10 @@ TxProposal.create = function(opts) {
x.outputs = _.map(opts.outputs, function(output) {
return _.pick(output, ['amount', 'toAddress', 'message', 'script']);
});
x.outputOrder = _.shuffle(_.range(x.outputs.length + 1));
x.outputOrder = _.range(x.outputs.length + 1);
if (!opts.noShuffleOutputs) {
x.outputOrder = _.shuffle(x.outputOrder);
}
x.walletM = opts.walletM;
x.walletN = opts.walletN;
x.requiredSignatures = x.walletM;

1
lib/server.js

@ -1926,6 +1926,7 @@ WalletService.prototype.createTx = function(opts, cb) {
customData: opts.customData,
inputs: opts.inputs,
fee: opts.inputs && !_.isNumber(opts.feePerKb) ? opts.fee : null,
noShuffleOutputs: opts.noShuffleOutputs
};
txp = Model.TxProposal.create(txOpts);

Loading…
Cancel
Save