@@ -24,7 +24,6 @@ import {
2424 UtxoPsbt ,
2525 UtxoTransaction ,
2626 verifySignatureWithUnspent ,
27- withUnsafeNonSegwit ,
2827} from '../bitgo' ;
2928import { Network } from '../networks' ;
3029import { mockReplayProtectionUnspent , mockWalletUnspent } from './mock' ;
@@ -115,32 +114,21 @@ export function signPsbtInput(
115114 params ?: {
116115 signers ?: { signerName : KeyName ; cosignerName ?: KeyName } ;
117116 deterministic ?: boolean ;
117+ // For backwards compatibility keep this here.
118118 skipNonWitnessUtxo ?: boolean ;
119119 }
120120) : void {
121- function signPsbt ( psbt : UtxoPsbt , signFunc : ( ) => void , skipNonWitnessUtxo ?: boolean ) {
122- if ( skipNonWitnessUtxo ) {
123- withUnsafeNonSegwit ( psbt , signFunc ) ;
124- } else {
125- signFunc ( ) ;
126- }
127- }
128-
129- const { signers, deterministic, skipNonWitnessUtxo } = params ?? { } ;
121+ const { signers, deterministic } = params ?? { } ;
130122 const { signerName, cosignerName } = signers ? signers : getSigners ( input . scriptType ) ;
131123 if ( sign === 'halfsigned' ) {
132124 if ( input . scriptType === 'p2shP2pk' ) {
133- signPsbt ( psbt , ( ) => psbt . signInput ( inputIndex , rootWalletKeys [ signerName ] ) , skipNonWitnessUtxo ) ;
125+ psbt . signInput ( inputIndex , rootWalletKeys [ signerName ] ) ;
134126 } else {
135- signPsbt ( psbt , ( ) => psbt . signInputHD ( inputIndex , rootWalletKeys [ signerName ] ) , skipNonWitnessUtxo ) ;
127+ psbt . signInputHD ( inputIndex , rootWalletKeys [ signerName ] ) ;
136128 }
137129 }
138130 if ( sign === 'fullsigned' && cosignerName && input . scriptType !== 'p2shP2pk' ) {
139- signPsbt (
140- psbt ,
141- ( ) => psbt . signInputHD ( inputIndex , rootWalletKeys [ cosignerName ] , { deterministic } ) ,
142- skipNonWitnessUtxo
143- ) ;
131+ psbt . signInputHD ( inputIndex , rootWalletKeys [ cosignerName ] , { deterministic } ) ;
144132 }
145133}
146134
@@ -156,12 +144,13 @@ export function signAllPsbtInputs(
156144 params ?: {
157145 signers ?: { signerName : KeyName ; cosignerName ?: KeyName } ;
158146 deterministic ?: boolean ;
147+ // For backwards compatibility keep this here.
159148 skipNonWitnessUtxo ?: boolean ;
160149 }
161150) : void {
162- const { signers, deterministic, skipNonWitnessUtxo } = params ?? { } ;
151+ const { signers, deterministic } = params ?? { } ;
163152 inputs . forEach ( ( input , inputIndex ) => {
164- signPsbtInput ( psbt , input , inputIndex , rootWalletKeys , sign , { signers, deterministic, skipNonWitnessUtxo } ) ;
153+ signPsbtInput ( psbt , input , inputIndex , rootWalletKeys , sign , { signers, deterministic } ) ;
165154 } ) ;
166155}
167156
0 commit comments