File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -697,27 +697,34 @@ export class Provider {
697697 } ) ;
698698 } else {
699699 const networkType = this . getActiveNetwork ( ) ;
700+ const network = getBitcoinNetwork ( networkType ) ;
700701 const psbtNetwork = getBitcoinNetwork ( networkType ) ;
701702
702703 const psbt =
703704 typeof _psbt === 'string'
704705 ? bitcoin . Psbt . fromHex ( _psbt as string , { network : psbtNetwork } )
705706 : ( _psbt as bitcoin . Psbt ) ;
706707 psbt . data . inputs . forEach ( ( v , index ) => {
708+ let address = '' ;
707709 let script : any = null ;
708710 let value = 0 ;
709711 if ( v . witnessUtxo ) {
710712 script = v . witnessUtxo . script ;
711713 value = v . witnessUtxo . value ;
714+ address = extractAddressFromScript ( {
715+ script,
716+ tapInternalKey : v . tapInternalKey ,
717+ network,
718+ } ) ;
712719 } else if ( v . nonWitnessUtxo ) {
713720 const tx = bitcoin . Transaction . fromBuffer ( v . nonWitnessUtxo ) ;
714721 const output = tx . outs [ psbt . txInputs [ index ] . index ] ;
715722 script = output . script ;
723+ address = convertScriptToAddress ( script , networkType ) ;
716724 value = output . value ;
717725 }
718726 const isSigned = v . finalScriptSig || v . finalScriptWitness ;
719727 if ( script && ! isSigned ) {
720- const address = convertScriptToAddress ( script , networkType ) ;
721728 if ( account . address === address ) {
722729 inputForSigns . push ( {
723730 index,
You can’t perform that action at this time.
0 commit comments