tx: minor.

This commit is contained in:
Christopher Jeffrey 2017-06-15 22:33:57 -07:00
parent 182784c8e0
commit ea26a0e70a
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -735,9 +735,6 @@ TX.prototype.signatureHashV1 = function signatureHashV1(index, prev, value, type
TX.prototype.checksig = function checksig(index, prev, value, sig, key, version) {
var type, hash;
if (type == null)
type = Script.hashType.ALL;
if (sig.length === 0)
return false;
@ -754,6 +751,7 @@ TX.prototype.checksig = function checksig(index, prev, value, sig, key, version)
* (in the case of witnesspubkeyhash, this should be the generated
* p2pkh script).
* @param {Amount} value - Previous output value.
* @param {Buffer} key
* @param {SighashType} type
* @param {Number} version - Sighash version (0=legacy, 1=segwit).
* @returns {Buffer} Signature in DER format.
@ -765,6 +763,9 @@ TX.prototype.signature = function signature(index, prev, value, key, type, versi
if (type == null)
type = Script.hashType.ALL;
if (version == null)
version = 0;
hash = this.signatureHash(index, prev, value, type, version);
sig = ec.sign(hash, key);