Browse Source

Transaction: add assertion that scriptPubKey exists

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
a90a8e061e
  1. 4
      src/transaction.js

4
src/transaction.js

@ -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…
Cancel
Save