@@ -35,7 +35,7 @@ use std::sync::Arc;
3535use bitcoin:: consensus:: encode:: serialize;
3636use bitcoin:: util:: bip32:: ChildNumber ;
3737use bitcoin:: util:: psbt:: PartiallySignedTransaction as PSBT ;
38- use bitcoin:: { Address , Network , OutPoint , Script , SigHashType , Transaction , TxOut , Txid } ;
38+ use bitcoin:: { Address , Network , OutPoint , Script , Transaction , TxOut , Txid } ;
3939
4040use miniscript:: psbt:: PsbtInputSatisfier ;
4141
@@ -1025,8 +1025,11 @@ where
10251025 None => continue ,
10261026 } ;
10271027
1028- // Add sighash, default is obviously "ALL"
1029- psbt_input. sighash_type = builder. sighash . or ( Some ( SigHashType :: All ) ) ;
1028+ // Only set it if the builder has a custom one, otherwise leave blank which defaults to
1029+ // SIGHASH_ALL
1030+ if let Some ( sighash_type) = builder. sighash {
1031+ psbt_input. sighash_type = Some ( sighash_type) ;
1032+ }
10301033
10311034 // Try to find the prev_script in our db to figure out if this is internal or external,
10321035 // and the derivation index
@@ -1742,7 +1745,7 @@ mod test {
17421745 ) ] ) )
17431746 . unwrap ( ) ;
17441747
1745- assert_eq ! ( psbt. inputs[ 0 ] . sighash_type, Some ( bitcoin :: SigHashType :: All ) ) ;
1748+ assert_eq ! ( psbt. inputs[ 0 ] . sighash_type, None ) ;
17461749 }
17471750
17481751 #[ test]
0 commit comments