Skip to content

Commit

Permalink
Transaction: add comment to explain -1 on add*
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Aug 20, 2014
1 parent 70be0d2 commit 4dd9ca7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4dd9ca7

Please sign in to comment.