@@ -19,6 +19,7 @@ use itertools::Itertools;
1919
2020use common:: {
2121 chain:: {
22+ config:: ChainType ,
2223 htlc:: HtlcSecret ,
2324 signature:: {
2425 inputsig:: {
@@ -46,7 +47,7 @@ use common::{
4647use crypto:: key:: {
4748 extended:: { ExtendedPrivateKey , ExtendedPublicKey } ,
4849 hdkd:: { derivable:: Derivable , u31:: U31 } ,
49- PrivateKey , SigAuxDataProvider ,
50+ PredefinedSigAuxDataProvider , PrivateKey , SigAuxDataProvider ,
5051} ;
5152use randomness:: make_true_rng;
5253use wallet_storage:: {
@@ -76,7 +77,22 @@ pub struct SoftwareSigner {
7677
7778impl SoftwareSigner {
7879 pub fn new ( chain_config : Arc < ChainConfig > , account_index : U31 ) -> Self {
79- Self :: new_with_sig_aux_data_provider ( chain_config, account_index, Box :: new ( make_true_rng ( ) ) )
80+ let use_deterministic_signer = * chain_config. chain_type ( ) == ChainType :: Regtest
81+ && cfg ! ( feature = "use-deterministic-signatures-in-software-signer-for-regtest" ) ;
82+
83+ if use_deterministic_signer {
84+ Self :: new_with_sig_aux_data_provider (
85+ chain_config,
86+ account_index,
87+ Box :: new ( PredefinedSigAuxDataProvider ) ,
88+ )
89+ } else {
90+ Self :: new_with_sig_aux_data_provider (
91+ chain_config,
92+ account_index,
93+ Box :: new ( make_true_rng ( ) ) ,
94+ )
95+ }
8096 }
8197
8298 pub fn new_with_sig_aux_data_provider (
0 commit comments