@@ -627,11 +627,13 @@ var DashTx = ("object" === typeof module && exports) || {};
627
627
* - ASC `outputIndex` (a.k.a. `output_index`, `vout`)
628
628
*/
629
629
Tx . sortInputs = function ( a , b ) {
630
+ let aTxid = a . txid || a . txId ;
631
+ let bTxid = b . txid || b . txId ;
630
632
// Ascending Lexicographical on TxId (prev-hash) in-memory (not wire) byte order
631
- if ( a . txId > b . txId ) {
633
+ if ( aTxid > bTxid ) {
632
634
return 1 ;
633
635
}
634
- if ( a . txId < b . txId ) {
636
+ if ( aTxid < bTxid ) {
635
637
return - 1 ;
636
638
}
637
639
@@ -986,7 +988,8 @@ var DashTx = ("object" === typeof module && exports) || {};
986
988
987
989
/** @type TxInputSigned */
988
990
let txInputSigned = {
989
- txId : txInput . txId ,
991
+ txId : txInput . txId || txInput . txid ,
992
+ txid : txInput . txId || txInput . txid ,
990
993
outputIndex : txInput . outputIndex ,
991
994
signature : sigHex ,
992
995
publicKey : pubKeyHex ,
@@ -1039,7 +1042,8 @@ var DashTx = ("object" === typeof module && exports) || {};
1039
1042
txInfoHashable . inputs = txInfo . inputs . map ( function ( input , i ) {
1040
1043
if ( inputIndex !== i ) {
1041
1044
return {
1042
- txId : input . txId ,
1045
+ txId : input . txId || input . txid ,
1046
+ txid : input . txId || input . txid ,
1043
1047
outputIndex : input . outputIndex ,
1044
1048
} ;
1045
1049
}
@@ -1054,7 +1058,8 @@ var DashTx = ("object" === typeof module && exports) || {};
1054
1058
lockScript = `${ PKH_SCRIPT_SIZE } ${ OP_DUP } ${ OP_HASH160 } ${ PKH_SIZE } ${ input . pubKeyHash } ${ OP_EQUALVERIFY } ${ OP_CHECKSIG } ` ;
1055
1059
}
1056
1060
return {
1057
- txId : input . txId ,
1061
+ txId : input . txId || input . txid ,
1062
+ txid : input . txId || input . txid ,
1058
1063
outputIndex : input . outputIndex ,
1059
1064
pubKeyHash : input . pubKeyHash ,
1060
1065
sigHashType : input . sigHashType ,
@@ -1122,7 +1127,7 @@ var DashTx = ("object" === typeof module && exports) || {};
1122
1127
for ( let input of inputs ) {
1123
1128
let inputHex = [ ] ;
1124
1129
1125
- let txId = input . txId ;
1130
+ let txId = input . txId || input . txid ;
1126
1131
if ( ! txId ) {
1127
1132
throw new Error ( "missing required utxo property 'txId'" ) ;
1128
1133
}
0 commit comments