diff --git a/src/ecsignature.js b/src/ecsignature.js index cbf9f81..151e962 100644 --- a/src/ecsignature.js +++ b/src/ecsignature.js @@ -71,7 +71,7 @@ ECSignature.parseScriptSignature = function (buffer) { var hashType = buffer.readUInt8(buffer.length - 1) var hashTypeMod = hashType & ~0x80 - assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType ' + hashType) + if (hashTypeMod <= 0x00 || hashTypeMod >= 0x04) throw new Error('Invalid hashType ' + hashType) return { signature: ECSignature.fromDER(buffer.slice(0, -1)),