tx: minor.
This commit is contained in:
parent
182784c8e0
commit
ea26a0e70a
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user