|
|
@ -136,7 +136,7 @@ ScriptInterpreter.prototype.checkSignatureEncoding = function(buf) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else if ((this.flags & ScriptInterpreter.SCRIPT_VERIFY_STRICTENC) !== 0) { |
|
|
|
sig = Signature().fromTxFormat(buf); |
|
|
|
sig = Signature.fromTxFormat(buf); |
|
|
|
if (!sig.hasDefinedHashtype()) { |
|
|
|
this.errstr = 'SCRIPT_ERR_SIG_HASHTYPE'; |
|
|
|
return false; |
|
|
@ -149,7 +149,7 @@ ScriptInterpreter.prototype.checkSignatureEncoding = function(buf) { |
|
|
|
* Translated from bitcoind's CheckPubKeyEncoding |
|
|
|
*/ |
|
|
|
ScriptInterpreter.prototype.checkPubkeyEncoding = function(buf) { |
|
|
|
if ((this.flags & ScriptInterpreter.SCRIPT_VERIFY_STRICTENC) !== 0 && !Pubkey.isCompressedOrUncompressed(buf)) { |
|
|
|
if ((this.flags & ScriptInterpreter.SCRIPT_VERIFY_STRICTENC) !== 0 && !PublicKey.isCompressedOrUncompressed(buf)) { |
|
|
|
this.errstr = 'SCRIPT_ERR_PUBKEYTYPE'; |
|
|
|
return false; |
|
|
|
} |
|
|
@ -889,7 +889,7 @@ ScriptInterpreter.prototype.step = function() { |
|
|
|
var fSuccess; |
|
|
|
try { |
|
|
|
var sig = Signature().fromTxFormat(bufSig); |
|
|
|
var pubkey = Pubkey().fromBuffer(bufPubkey, false); |
|
|
|
var pubkey = PublicKey().fromBuffer(bufPubkey, false); |
|
|
|
fSuccess = this.tx.verify(sig, pubkey, this.nin, subscript); |
|
|
|
} catch (e) { |
|
|
|
//invalid sig or pubkey
|
|
|
@ -979,7 +979,7 @@ ScriptInterpreter.prototype.step = function() { |
|
|
|
var fOk; |
|
|
|
try { |
|
|
|
var sig = Signature().fromTxFormat(bufSig); |
|
|
|
var pubkey = Pubkey().fromBuffer(bufPubkey, false); |
|
|
|
var pubkey = PublicKey().fromBuffer(bufPubkey, false); |
|
|
|
fOk = this.tx.verify(sig, pubkey, this.nin, subscript); |
|
|
|
} catch (e) { |
|
|
|
//invalid sig or pubkey
|
|
|
|