opcode: fix uncatchable error on .equals().
This commit is contained in:
parent
f1ac30a6c1
commit
22a879f154
@ -429,9 +429,6 @@ Opcode.fromOp = function fromOp(op) {
|
||||
Opcode.fromData = function fromData(data) {
|
||||
assert(Buffer.isBuffer(data));
|
||||
|
||||
if (data.length === 0)
|
||||
return Opcode.fromOp(opcodes.OP_0);
|
||||
|
||||
if (data.length === 1) {
|
||||
if (data[0] >= 1 && data[0] <= 16)
|
||||
return Opcode.fromOp(data[0] + 0x50);
|
||||
@ -454,6 +451,9 @@ Opcode.fromData = function fromData(data) {
|
||||
Opcode.fromPush = function fromPush(data) {
|
||||
assert(Buffer.isBuffer(data));
|
||||
|
||||
if (data.length === 0)
|
||||
return Opcode.fromOp(opcodes.OP_0);
|
||||
|
||||
if (data.length <= 0x4b)
|
||||
return new Opcode(data.length, data);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user