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) {
|
TX.prototype.checksig = function checksig(index, prev, value, sig, key, version) {
|
||||||
var type, hash;
|
var type, hash;
|
||||||
|
|
||||||
if (type == null)
|
|
||||||
type = Script.hashType.ALL;
|
|
||||||
|
|
||||||
if (sig.length === 0)
|
if (sig.length === 0)
|
||||||
return false;
|
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
|
* (in the case of witnesspubkeyhash, this should be the generated
|
||||||
* p2pkh script).
|
* p2pkh script).
|
||||||
* @param {Amount} value - Previous output value.
|
* @param {Amount} value - Previous output value.
|
||||||
|
* @param {Buffer} key
|
||||||
* @param {SighashType} type
|
* @param {SighashType} type
|
||||||
* @param {Number} version - Sighash version (0=legacy, 1=segwit).
|
* @param {Number} version - Sighash version (0=legacy, 1=segwit).
|
||||||
* @returns {Buffer} Signature in DER format.
|
* @returns {Buffer} Signature in DER format.
|
||||||
@ -765,6 +763,9 @@ TX.prototype.signature = function signature(index, prev, value, key, type, versi
|
|||||||
if (type == null)
|
if (type == null)
|
||||||
type = Script.hashType.ALL;
|
type = Script.hashType.ALL;
|
||||||
|
|
||||||
|
if (version == null)
|
||||||
|
version = 0;
|
||||||
|
|
||||||
hash = this.signatureHash(index, prev, value, type, version);
|
hash = this.signatureHash(index, prev, value, type, version);
|
||||||
|
|
||||||
sig = ec.sign(hash, key);
|
sig = ec.sign(hash, key);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user