fix minimal check. small ints.

This commit is contained in:
Christopher Jeffrey 2016-07-01 18:28:22 -07:00
parent 4e80320953
commit b59f6ae384
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -2548,12 +2548,12 @@ Script.prototype.fromMultisig = function fromMultisig(m, n, keys) {
keys = utils.sortKeys(keys);
this.push(m + 0x50);
this.push(Opcode.fromSmall(m));
for (i = 0; i < keys.length; i++)
this.push(keys[i]);
this.push(n + 0x50);
this.push(Opcode.fromSmall(n));
this.push(opcodes.OP_CHECKMULTISIG);
this.compile();
@ -2633,7 +2633,7 @@ Script.fromNulldata = function fromNulldata(flags) {
Script.prototype.fromProgram = function fromProgram(version, data) {
assert(utils.isNumber(version) && version >= 0 && version <= 16);
assert(Buffer.isBuffer(data) && data.length >= 2 && data.length <= 40);
this.push(version === 0 ? 0 : version + 0x50);
this.push(Opcode.fromSmall(version));
this.push(data);
this.compile();
return this;
@ -2850,7 +2850,7 @@ Script.prototype.isPubkey = function isPubkey(minimal) {
*/
Script.prototype.isPubkeyhash = function isPubkeyhash(minimal) {
if (!minimal) {
if (minimal) {
return this.raw.length === 25
&& this.raw[0] === opcodes.OP_DUP
&& this.raw[1] === opcodes.OP_HASH160