Transaction: remove untested TransactionIn constructor params
This commit is contained in:
parent
9b89a267ca
commit
e49e1796d5
1 changed files with 3 additions and 12 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue