@@ -562,9 +562,15 @@ impl OmniLockScriptSigner {
562562
563563 let zero_lock = self . config . zero_lock ( self . unlock_mode ) ?;
564564 let zero_lock_len = zero_lock. len ( ) ;
565- let ( message, open_sig_data) = if let Some ( opentx_wit) = self . config . get_opentx_input ( ) {
566- let reader = OpenTxReader :: new ( & tx_new, tx_dep_provider, script_group) ?;
567- opentx_wit. generate_message ( & reader) ?
565+ let ( message, open_sig_data) = if self . config . is_opentx_mode ( ) {
566+ if let Some ( opentx_wit) = self . config . get_opentx_input ( ) {
567+ let reader = OpenTxReader :: new ( & tx_new, tx_dep_provider, script_group) ?;
568+ opentx_wit. generate_message ( & reader) ?
569+ } else {
570+ return Err ( ScriptSignError :: OpenTxError (
571+ OpenTxError :: InputListConfigMissing ,
572+ ) ) ;
573+ }
568574 } else {
569575 (
570576 generate_message ( & tx_new, script_group, zero_lock) ?,
@@ -692,9 +698,14 @@ impl OmniLockScriptSigner {
692698 } else {
693699 WitnessArgs :: from_slice ( witness_data. as_ref ( ) ) ?
694700 } ;
695-
696- if let Some ( opentx_wit) = self . config . get_opentx_input ( ) {
697- signature = opentx_wit. build_opentx_sig ( open_sig_data, signature) ;
701+ if self . config . is_opentx_mode ( ) {
702+ if let Some ( opentx_wit) = self . config . get_opentx_input ( ) {
703+ signature = opentx_wit. build_opentx_sig ( open_sig_data, signature) ;
704+ } else {
705+ return Err ( ScriptSignError :: OpenTxError (
706+ OpenTxError :: InputListConfigMissing ,
707+ ) ) ;
708+ }
698709 }
699710 let lock = Self :: build_witness_lock ( current_witness. lock ( ) , signature) ?;
700711 current_witness = current_witness. as_builder ( ) . lock ( Some ( lock) . pack ( ) ) . build ( ) ;
@@ -830,9 +841,14 @@ impl ScriptSigner for OmniLockScriptSigner {
830841 } else {
831842 WitnessArgs :: from_slice ( witness_data. as_ref ( ) ) ?
832843 } ;
833-
834- if let Some ( opentx_wit) = self . config . get_opentx_input ( ) {
835- signature = opentx_wit. build_opentx_sig ( open_sig_data, signature) ;
844+ if self . config . is_opentx_mode ( ) {
845+ if let Some ( opentx_wit) = self . config . get_opentx_input ( ) {
846+ signature = opentx_wit. build_opentx_sig ( open_sig_data, signature) ;
847+ } else {
848+ return Err ( ScriptSignError :: OpenTxError (
849+ OpenTxError :: InputListConfigMissing ,
850+ ) ) ;
851+ }
836852 }
837853 let lock = Self :: build_witness_lock ( current_witness. lock ( ) , signature) ?;
838854
0 commit comments