File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ pub async fn setup(options: Options) -> Result<Node> {
214214 . await
215215 }
216216 Command :: Regtest ( ref regtest_options) => {
217- let chain_config = regtest_chain_config ( & regtest_options. chain_config ) ?;
217+ let chain_config = regtest_chain_config ( & command , & regtest_options. chain_config ) ?;
218218 start (
219219 & options. config_path ( * chain_config. chain_type ( ) ) ,
220220 & options. data_dir ,
@@ -322,7 +322,14 @@ async fn start(
322322 } )
323323}
324324
325- fn regtest_chain_config ( options : & ChainConfigOptions ) -> Result < ChainConfig > {
325+ fn regtest_chain_config ( command : & Command , options : & ChainConfigOptions ) -> Result < ChainConfig > {
326+ match command {
327+ Command :: Regtest ( _) => { }
328+ Command :: Mainnet ( _) | Command :: Testnet ( _) => {
329+ panic ! ( "RegTest configuration options must only be used on RegTest" )
330+ }
331+ } ;
332+
326333 let ChainConfigOptions {
327334 chain_max_future_block_time_offset,
328335 chain_version,
You can’t perform that action at this time.
0 commit comments