script: stop using new Opcode.
This commit is contained in:
parent
040e798d9f
commit
5047028511
@ -1405,7 +1405,7 @@ Script.prototype.fromPubkey = function fromPubkey(key) {
|
||||
key = this.raw.slice(1, 1 + key.length);
|
||||
|
||||
this.code.push(new Opcode(key.length, key));
|
||||
this.code.push(new Opcode(opcodes.OP_CHECKSIG));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_CHECKSIG));
|
||||
|
||||
return this;
|
||||
};
|
||||
@ -1439,11 +1439,11 @@ Script.prototype.fromPubkeyhash = function fromPubkeyhash(hash) {
|
||||
|
||||
hash = this.raw.slice(3, 23);
|
||||
|
||||
this.code.push(new Opcode(opcodes.OP_DUP));
|
||||
this.code.push(new Opcode(opcodes.OP_HASH160));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_DUP));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_HASH160));
|
||||
this.code.push(new Opcode(0x14, hash));
|
||||
this.code.push(new Opcode(opcodes.OP_EQUALVERIFY));
|
||||
this.code.push(new Opcode(opcodes.OP_CHECKSIG));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_EQUALVERIFY));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_CHECKSIG));
|
||||
|
||||
return this;
|
||||
};
|
||||
@ -1517,9 +1517,9 @@ Script.prototype.fromScripthash = function fromScripthash(hash) {
|
||||
|
||||
hash = this.raw.slice(2, 22);
|
||||
|
||||
this.code.push(new Opcode(opcodes.OP_HASH160));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_HASH160));
|
||||
this.code.push(new Opcode(0x14, hash));
|
||||
this.code.push(new Opcode(opcodes.OP_EQUAL));
|
||||
this.code.push(Opcode.fromOp(opcodes.OP_EQUAL));
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user