Comparing version 0.12.13 to 0.12.14
@@ -35,2 +35,10 @@ 'use strict'; | ||
function isPublicKeyOut() { | ||
if (c >= scripts.length) { | ||
c = 0; | ||
} | ||
scripts[c].isPublicKeyOut(); | ||
c++; | ||
} | ||
function isPublicKeyHashIn() { | ||
@@ -62,2 +70,3 @@ if (c >= scripts.length) { | ||
suite.add('isPublicKeyHashIn', isPublicKeyHashIn, {maxTime: maxTime}); | ||
suite.add('isPublicKeyOut', isPublicKeyOut, {maxTime: maxTime}); | ||
suite.add('toAddress', toAddress, {maxTime: maxTime}); | ||
@@ -64,0 +73,0 @@ suite.add('getAddressInfo', getAddressInfo, {maxTime: maxTime}); |
{ | ||
"name": "bitcore", | ||
"main": "./bitcore.min.js", | ||
"version": "0.12.13", | ||
"version": "0.12.14", | ||
"homepage": "http://bitcore.io", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -279,6 +279,21 @@ 'use strict'; | ||
Script.prototype.isPublicKeyOut = function() { | ||
return this.chunks.length === 2 && | ||
BufferUtil.isBuffer(this.chunks[0].buf) && | ||
PublicKey.isValid(this.chunks[0].buf) && | ||
this.chunks[1].opcodenum === Opcode.OP_CHECKSIG; | ||
if (this.chunks.length === 2 && | ||
this.chunks[0].buf && | ||
this.chunks[0].buf.length && | ||
this.chunks[1].opcodenum === Opcode.OP_CHECKSIG) { | ||
var pubkeyBuf = this.chunks[0].buf; | ||
var version = pubkeyBuf[0]; | ||
var isVersion = false; | ||
if ((version === 0x04 || | ||
version === 0x06 || | ||
version === 0x07) && pubkeyBuf.length === 65) { | ||
isVersion = true; | ||
} else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) { | ||
isVersion = true; | ||
} | ||
if (isVersion) { | ||
return PublicKey.isValid(pubkeyBuf); | ||
} | ||
} | ||
return false; | ||
}; | ||
@@ -285,0 +300,0 @@ |
{ | ||
"name": "bitcore", | ||
"version": "0.12.12", | ||
"version": "0.12.13", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "bn.js": { |
{ | ||
"name": "bitcore", | ||
"version": "0.12.13", | ||
"version": "0.12.14", | ||
"description": "A pure and powerful JavaScript Bitcoin library.", | ||
@@ -5,0 +5,0 @@ "author": "BitPay <dev@bitpay.com>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2019307
25732
0