diff --git a/src/transaction.js b/src/transaction.js index d8a0fc47b3..acf345881d 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -53,6 +53,7 @@ Transaction.prototype.addInput = function(tx, index, sequence) { assert.equal(hash.length, 32, 'Expected hash length of 32, got ' + hash.length) assert.equal(typeof index, 'number', 'Expected number index, got ' + index) + // Add the input, and return the input's index from Array.push return (this.ins.push({ hash: hash, index: index, @@ -86,6 +87,7 @@ Transaction.prototype.addOutput = function(scriptPubKey, value) { assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey) assert.equal(typeof value, 'number', 'Expected number value, got ' + value) + // Add the output, and return the output's index from Array.push return (this.outs.push({ script: scriptPubKey, value: value