Skip to content

Commit c2e7840

Browse files
committed
Transaction: adds assert for invalid value type
1 parent 5cbb4af commit c2e7840

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/transaction.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Transaction.prototype.addOutput = function(scriptPubKey, value) {
8585
}
8686

8787
assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey)
88+
assert.equal(typeof value, 'number', 'Expected number value, got ' + value)
8889

8990
return (this.outs.push({
9091
script: scriptPubKey,

0 commit comments

Comments
 (0)