From e49e1796d53898f35bfd733242699430115bd16b Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sat, 14 Jun 2014 23:48:26 +1000 Subject: [PATCH] Transaction: remove untested TransactionIn constructor params --- src/transaction.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/transaction.js b/src/transaction.js index eed58ed..6ff1c23 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -384,16 +384,9 @@ Transaction.prototype.estimateFee = function(feePerKb){ return feePerKb * Math.ceil(size / 1000) } -var TransactionIn = function (data) { - if (typeof data == "string") { - this.outpoint = { hash: data.split(':')[0], index: data.split(':')[1] } - } else if (data.outpoint) { - this.outpoint = data.outpoint - } else { - this.outpoint = { hash: data.hash, index: data.index } - } - - assert(data.script, 'Invalid TxIn parameters') +function TransactionIn(data) { + assert(data.outpoint && data.script, 'Invalid TxIn parameters') + this.outpoint = data.outpoint this.script = data.script this.sequence = data.sequence == undefined ? DEFAULT_SEQUENCE : data.sequence } @@ -413,8 +406,6 @@ function TransactionOut(data) { this.script = data.script this.value = data.value this.address = data.address - - if (data.address) this.address = data.address } TransactionOut.prototype.clone = function() {