File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ pub struct PsbtParams {
4444 ///
4545 /// [`non_witness_utxo`]: bitcoin::psbt::Input::non_witness_utxo
4646 pub mandate_full_tx_for_segwit_v0 : bool ,
47+
48+ /// Sighash type to be used for each input.
49+ ///
50+ /// This option only applies to [`Input`]s that include a plan, as otherwise the given PSBT
51+ /// input can be expected to set a specific sighash type. Defaults to `None` which will not
52+ /// set an explicit sighash type for any input. (In that case the sighash will typically
53+ /// cover all of the outputs).
54+ pub sighash_type : Option < bitcoin:: psbt:: PsbtSighashType > ,
4755}
4856
4957impl Default for PsbtParams {
@@ -53,6 +61,7 @@ impl Default for PsbtParams {
5361 fallback_locktime : absolute:: LockTime :: ZERO ,
5462 fallback_sequence : FALLBACK_SEQUENCE ,
5563 mandate_full_tx_for_segwit_v0 : true ,
64+ sighash_type : None ,
5665 }
5766 }
5867}
@@ -179,6 +188,9 @@ impl Selection {
179188 ) ) ;
180189 }
181190 }
191+
192+ psbt_input. sighash_type = params. sighash_type ;
193+
182194 continue ;
183195 }
184196 unreachable ! ( "input candidate must either have finalized psbt input or plan" ) ;
You can’t perform that action at this time.
0 commit comments