@@ -606,8 +606,11 @@ Transaction.prototype._newTransaction = function() {
606606 * @param {Array= } pubkeys
607607 * @param {number= } threshold
608608 * @param {boolean= } nestedWitness - Indicates that the utxo is nested witness p2sh
609+ * @param {Object= } opts - Several options:
610+ * - noSorting: defaults to false, if true and is multisig, don't
611+ * sort the given public keys before creating the script
609612 */
610- Transaction . prototype . from = function ( utxo , pubkeys , threshold , nestedWitness ) {
613+ Transaction . prototype . from = function ( utxo , pubkeys , threshold , nestedWitness , opts ) {
611614 if ( _ . isArray ( utxo ) ) {
612615 var self = this ;
613616 _ . each ( utxo , function ( utxo ) {
@@ -623,7 +626,7 @@ Transaction.prototype.from = function(utxo, pubkeys, threshold, nestedWitness) {
623626 return this ;
624627 }
625628 if ( pubkeys && threshold ) {
626- this . _fromMultisigUtxo ( utxo , pubkeys , threshold , nestedWitness ) ;
629+ this . _fromMultisigUtxo ( utxo , pubkeys , threshold , nestedWitness , opts ) ;
627630 } else {
628631 this . _fromNonP2SH ( utxo ) ;
629632 }
@@ -651,7 +654,7 @@ Transaction.prototype._fromNonP2SH = function(utxo) {
651654 } ) ) ;
652655} ;
653656
654- Transaction . prototype . _fromMultisigUtxo = function ( utxo , pubkeys , threshold , nestedWitness ) {
657+ Transaction . prototype . _fromMultisigUtxo = function ( utxo , pubkeys , threshold , nestedWitness , opts ) {
655658 $ . checkArgument ( threshold <= pubkeys . length ,
656659 'Number of required signatures must be greater than the number of public keys' ) ;
657660 var clazz ;
@@ -671,7 +674,7 @@ Transaction.prototype._fromMultisigUtxo = function(utxo, pubkeys, threshold, nes
671674 prevTxId : utxo . txId ,
672675 outputIndex : utxo . outputIndex ,
673676 script : Script . empty ( )
674- } , pubkeys , threshold , false , nestedWitness ) ) ;
677+ } , pubkeys , threshold , false , nestedWitness , opts ) ) ;
675678} ;
676679
677680/**
0 commit comments