minimaldata.

This commit is contained in:
Christopher Jeffrey 2016-04-17 21:16:44 -07:00
parent ec5c548fe1
commit 6fc3c15c77
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -3921,6 +3921,18 @@ Script.encode = function encode(code, writer) {
if (op.length === 0) {
p.writeU8(opcodes.OP_0);
} else if (op.length <= 0x4b) {
if (op.length === 1) {
if (op[0] === 0) {
p.writeU8(opcodes.OP_0);
continue;
} else if (op[0] >= 1 && op[0] <= 16) {
p.writeU8(op[0] + 0x50);
continue;
} else if (op[0] === 0xff) {
p.writeU8(opcodes.OP_1NEGATE);
continue;
}
}
p.writeU8(op.length);
p.writeBytes(op);
} else if (op.length <= 0xff) {