12
12
* @prop {Uint32|0x00000002 } SIGHASH_NONE - 0x02
13
13
* @prop {Uint32|0x00000003 } SIGHASH_SINGLE - 0x03 - Not Supported
14
14
* @prop {Uint32|0x00000080 } SIGHASH_ANYONECANPAY - 0x80
15
+ * @prop {Uint32|0x00000081 } SIGHASH_DEFAULT - 0x81
15
16
* @prop {TxAppraise } appraise
16
17
* @prop {TxAppraiseCounts } _appraiseCounts
17
18
* @prop {TxAppraiseMemos } _appraiseMemos
@@ -173,6 +174,7 @@ var DashTx = ("object" === typeof module && exports) || {};
173
174
Tx . SIGHASH_NONE = 0x02 ;
174
175
Tx . SIGHASH_SINGLE = 0x03 ; // Not Supported
175
176
Tx . SIGHASH_ANYONECANPAY = 0x80 ;
177
+ Tx . SIGHASH_DEFAULT = Tx . SIGHASH_ALL | Tx . SIGHASH_ANYONECANPAY ;
176
178
177
179
Tx . appraise = function ( txInfo ) {
178
180
let extraSize = Tx . _appraiseMemos ( txInfo . outputs ) ;
@@ -343,7 +345,8 @@ var DashTx = ("object" === typeof module && exports) || {};
343
345
) {
344
346
let txInput = txInfo . inputs [ i ] ;
345
347
346
- let _sigHashType = txInput . sigHashType ?? sigHashType ?? Tx . SIGHASH_ALL ;
348
+ let _sigHashType =
349
+ txInput . sigHashType ?? sigHashType ?? Tx . SIGHASH_DEFAULT ;
347
350
348
351
// let inputs = Tx.selectSigHashInputs(txInfo, i, _sigHashType);
349
352
// let outputs = Tx.selectSigHashOutputs(txInfo, i, _sigHashType);
@@ -635,8 +638,12 @@ var DashTx = ("object" === typeof module && exports) || {};
635
638
return txInst ;
636
639
} ;
637
640
638
- Tx . selectSigHashInputs = function ( txInfo , i , sigHashType = Tx . SIGHASH_ALL ) {
639
- let inputs = txInfo . inputs ; // default (not Tx.SIGHASH_ANYONECANPAY)
641
+ Tx . selectSigHashInputs = function (
642
+ txInfo ,
643
+ i ,
644
+ sigHashType = Tx . SIGHASH_DEFAULT ,
645
+ ) {
646
+ let inputs = txInfo . inputs ;
640
647
641
648
if ( sigHashType & Tx . SIGHASH_ANYONECANPAY ) {
642
649
let txInput = txInfo . inputs [ i ] ;
@@ -646,7 +653,11 @@ var DashTx = ("object" === typeof module && exports) || {};
646
653
return inputs ;
647
654
} ;
648
655
649
- Tx . selectSigHashOutputs = function ( txInfo , i , sigHashType = Tx . SIGHASH_ALL ) {
656
+ Tx . selectSigHashOutputs = function (
657
+ txInfo ,
658
+ i ,
659
+ sigHashType = Tx . SIGHASH_DEFAULT ,
660
+ ) {
650
661
let outputs = txInfo . outputs ;
651
662
if ( sigHashType & Tx . SIGHASH_ALL ) {
652
663
return outputs ;
@@ -1954,7 +1965,7 @@ if ("object" === typeof module) {
1954
1965
* @prop {String } [script] - the previous lock script (default: derived from public key as p2pkh)
1955
1966
* @prop {String } publicKey - hex-encoded public key (typically starts with a 0x02 or 0x03 prefix)
1956
1967
* @prop {String } [pubKeyHash] - the 20-byte pubKeyHash (address without magic byte or checksum)
1957
- * @prop {Uint32 } sigHashType - typically 0x01 (SIGHASH_ALL)
1968
+ * @prop {Uint32 } sigHashType - typically 0x81 (SIGHASH_ALL|SIGHASH_ANYONECANPAY )
1958
1969
*/
1959
1970
1960
1971
/**
@@ -1968,7 +1979,7 @@ if ("object" === typeof module) {
1968
1979
* @prop {String } [script] - the previous lock script (default: derived from public key as p2pkh)
1969
1980
* @prop {String } [publicKey] - hex-encoded public key (typically starts with a 0x02 or 0x03 prefix)
1970
1981
* @prop {String } [pubKeyHash] - the 20-byte pubKeyHash (address without magic byte or checksum)
1971
- * @prop {Uint32 } [ sigHashType] - typically 0x01 (SIGHASH_ALL)
1982
+ * @prop {Uint32 } sigHashType - typically 0x81 (SIGHASH_ALL|SIGHASH_ANYONECANPAY )
1972
1983
*/
1973
1984
1974
1985
/**
0 commit comments