Transaction: adds assert for invalid value type
This commit is contained in:
parent
5cbb4af7b4
commit
c2e7840c4f
1 changed files with 1 additions and 0 deletions
|
@ -85,6 +85,7 @@ Transaction.prototype.addOutput = function(scriptPubKey, value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey)
|
assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey)
|
||||||
|
assert.equal(typeof value, 'number', 'Expected number value, got ' + value)
|
||||||
|
|
||||||
return (this.outs.push({
|
return (this.outs.push({
|
||||||
script: scriptPubKey,
|
script: scriptPubKey,
|
||||||
|
|
Loading…
Add table
Reference in a new issue