|
@ -402,10 +402,10 @@ Transaction.prototype._fromMultisigUtxo = function(utxo, pubkeys, threshold) { |
|
|
*/ |
|
|
*/ |
|
|
Transaction.prototype.addInput = function(input, outputScript, satoshis) { |
|
|
Transaction.prototype.addInput = function(input, outputScript, satoshis) { |
|
|
$.checkArgumentType(input, Input, 'input'); |
|
|
$.checkArgumentType(input, Input, 'input'); |
|
|
if (!input.output || !(input.output instanceof Output) && !outputScript && !satoshis) { |
|
|
if (!input.output && (_.isUndefined(outputScript) || _.isUndefined(satoshis))) { |
|
|
throw new errors.Transaction.NeedMoreInfo('Need information about the UTXO script and satoshis'); |
|
|
throw new errors.Transaction.NeedMoreInfo('Need information about the UTXO script and satoshis'); |
|
|
} |
|
|
} |
|
|
if (!input.output && outputScript && satoshis) { |
|
|
if (!input.output && outputScript && !_.isUndefined(satoshis)) { |
|
|
outputScript = outputScript instanceof Script ? outputScript : new Script(outputScript); |
|
|
outputScript = outputScript instanceof Script ? outputScript : new Script(outputScript); |
|
|
$.checkArgumentType(satoshis, 'number', 'satoshis'); |
|
|
$.checkArgumentType(satoshis, 'number', 'satoshis'); |
|
|
input.output = new Output({ |
|
|
input.output = new Output({ |
|
|