Browse Source

Pubkey -> PublicKey

patch-2
Manuel Araoz 10 years ago
parent
commit
401b5b1b4a
  1. 8
      lib/script_interpreter.js

8
lib/script_interpreter.js

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

Loading…
Cancel
Save