Transaction: add assertion that scriptPubKey exists
This commit is contained in:
parent
56d9ea6618
commit
a90a8e061e
1 changed files with 3 additions and 1 deletions
|
@ -84,9 +84,11 @@ Transaction.prototype.addOutput = function(scriptPubKey, value) {
|
||||||
scriptPubKey = address.toOutputScript()
|
scriptPubKey = address.toOutputScript()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey)
|
||||||
|
|
||||||
return (this.outs.push({
|
return (this.outs.push({
|
||||||
script: scriptPubKey,
|
script: scriptPubKey,
|
||||||
value: value,
|
value: value
|
||||||
}) - 1)
|
}) - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue