diff --git a/src/transaction.js b/src/transaction.js index 0926b84..80393b9 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -84,9 +84,11 @@ Transaction.prototype.addOutput = function(scriptPubKey, value) { scriptPubKey = address.toOutputScript() } + assert(scriptPubKey instanceof Script, 'Expected Address or Script, got ' + scriptPubKey) + return (this.outs.push({ script: scriptPubKey, - value: value, + value: value }) - 1) }