script optimization.
This commit is contained in:
parent
76b79ab25d
commit
a84f087e2e
@ -101,6 +101,9 @@ script.encode = function encode(s) {
|
|||||||
if (!s)
|
if (!s)
|
||||||
return new Buffer([]);
|
return new Buffer([]);
|
||||||
|
|
||||||
|
if (s._raw)
|
||||||
|
return s._raw;
|
||||||
|
|
||||||
var opcodes = constants.opcodes;
|
var opcodes = constants.opcodes;
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var instr;
|
var instr;
|
||||||
@ -111,9 +114,6 @@ script.encode = function encode(s) {
|
|||||||
for (i = 0; i < s.length; i++) {
|
for (i = 0; i < s.length; i++) {
|
||||||
instr = s[i];
|
instr = s[i];
|
||||||
|
|
||||||
if (Array.isArray(instr))
|
|
||||||
instr = s[i] = new Buffer(instr);
|
|
||||||
|
|
||||||
if (Buffer.isBuffer(instr)) {
|
if (Buffer.isBuffer(instr)) {
|
||||||
if (instr.pushdata) {
|
if (instr.pushdata) {
|
||||||
if (instr.pushdata.opcode === null) {
|
if (instr.pushdata.opcode === null) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user