Browse Source

Script: more consistent input handling

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
929b8d2b62
  1. 8
      src/script.js

8
src/script.js

@ -6,10 +6,10 @@ var Network = require('./network')
var Opcode = require('./opcode')
function Script(data) {
this.buffer = data || []
if(!Array.isArray(this.buffer)) {
throw new Error('expect Script to be initialized with Array, but got ' + data)
}
data = data || []
assert(Array.isArray(data), 'Expected Array, got ' + data)
this.buffer = data
this.parse()
}

Loading…
Cancel
Save