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() {