ECSignature: further avoidance of assert

This commit is contained in:
Daniel Cousens 2015-08-07 16:12:17 +10:00
parent 9d1c610c08
commit 64657eb81f

View file

@ -71,7 +71,7 @@ ECSignature.parseScriptSignature = function (buffer) {
var hashType = buffer.readUInt8(buffer.length - 1) var hashType = buffer.readUInt8(buffer.length - 1)
var hashTypeMod = hashType & ~0x80 var hashTypeMod = hashType & ~0x80
assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType ' + hashType) if (hashTypeMod <= 0x00 || hashTypeMod >= 0x04) throw new Error('Invalid hashType ' + hashType)
return { return {
signature: ECSignature.fromDER(buffer.slice(0, -1)), signature: ECSignature.fromDER(buffer.slice(0, -1)),