|
@ -282,12 +282,16 @@ Script.prototype.isPublicKeyOut = function() { |
|
|
this.chunks[1].opcodenum === Opcode.OP_CHECKSIG) { |
|
|
this.chunks[1].opcodenum === Opcode.OP_CHECKSIG) { |
|
|
var pubkeyBuf = this.chunks[0].buf; |
|
|
var pubkeyBuf = this.chunks[0].buf; |
|
|
var version = pubkeyBuf[0]; |
|
|
var version = pubkeyBuf[0]; |
|
|
|
|
|
var isVersion = false; |
|
|
if ((version === 0x04 || |
|
|
if ((version === 0x04 || |
|
|
version === 0x06 || |
|
|
version === 0x06 || |
|
|
version === 0x07) && pubkeyBuf.length === 65) { |
|
|
version === 0x07) && pubkeyBuf.length === 65) { |
|
|
return true; |
|
|
isVersion = true; |
|
|
} else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { |
|
|
} else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { |
|
|
return true; |
|
|
isVersion = true; |
|
|
|
|
|
} |
|
|
|
|
|
if (isVersion) { |
|
|
|
|
|
return PublicKey.isValid(pubkeyBuf); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return false; |
|
|
return false; |
|
|