Transaction: remove untested TransactionIn constructor params

This commit is contained in:
Daniel Cousens 2014-06-14 23:48:26 +10:00
parent 9b89a267ca
commit e49e1796d5

View file

@ -384,16 +384,9 @@ Transaction.prototype.estimateFee = function(feePerKb){
return feePerKb * Math.ceil(size / 1000) return feePerKb * Math.ceil(size / 1000)
} }
var TransactionIn = function (data) { function TransactionIn(data) {
if (typeof data == "string") { assert(data.outpoint && data.script, 'Invalid TxIn parameters')
this.outpoint = { hash: data.split(':')[0], index: data.split(':')[1] } this.outpoint = data.outpoint
} else if (data.outpoint) {
this.outpoint = data.outpoint
} else {
this.outpoint = { hash: data.hash, index: data.index }
}
assert(data.script, 'Invalid TxIn parameters')
this.script = data.script this.script = data.script
this.sequence = data.sequence == undefined ? DEFAULT_SEQUENCE : data.sequence this.sequence = data.sequence == undefined ? DEFAULT_SEQUENCE : data.sequence
} }
@ -413,8 +406,6 @@ function TransactionOut(data) {
this.script = data.script this.script = data.script
this.value = data.value this.value = data.value
this.address = data.address this.address = data.address
if (data.address) this.address = data.address
} }
TransactionOut.prototype.clone = function() { TransactionOut.prototype.clone = function() {