script parsing.

This commit is contained in:
Christopher Jeffrey 2016-03-31 02:44:59 -07:00
parent b084913680
commit d158918a14

View File

@ -2723,9 +2723,6 @@ Script.decode = function decode(buf) {
// buffer slices should _never_ be passed in here.
while (off < buf.length) {
op = buf[off++];
// Direct Push
// Next `op` bytes should be pushed to stack
if (op >= 0x01 && op <= 0x4b) {
code.push(buf.slice(off, off + op));
off += op;
@ -2735,15 +2732,7 @@ Script.decode = function decode(buf) {
size: op
});
}
continue;
}
if (off >= buf.length) {
code.push(op);
continue;
}
if (op === opcodes.OP_PUSHDATA1) {
} else if (op === opcodes.OP_PUSHDATA1) {
size = buf[off];
off += 1;
code.push(buf.slice(off, off + size));