diff --git a/src/init.cpp b/src/init.cpp index fcd4aab312d37..bfbb72c31c8c7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1418,6 +1418,10 @@ bool AppInitParameterInteraction(const ArgsManager& args) nMaxTipAge = args.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); + if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "").empty()) { + return InitError(_("No proxy server specified. Use -proxy= or -proxy=.")); + } + try { const bool fRecoveryEnabled{llmq::utils::QuorumDataRecoveryEnabled()}; const bool fQuorumVvecRequestsEnabled{llmq::utils::GetEnabledQuorumVvecSyncEntries().size() > 0}; diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py index f7e913320f4e0..fd161bf4ae79c 100755 --- a/test/functional/feature_config_args.py +++ b/test/functional/feature_config_args.py @@ -81,6 +81,11 @@ def test_config_file_parser(self): with open(inc_conf_file2_path, 'w', encoding='utf-8') as conf: conf.write('') # clear + def test_invalid_command_line_options(self): + self.nodes[0].assert_start_raises_init_error( + expected_msg='Error: No proxy server specified. Use -proxy= or -proxy=.', + extra_args=['-proxy'], + ) def test_log_buffer(self): with self.nodes[0].assert_debug_log(expected_msgs=['Warning: parsed potentially confusing double-negative -connect=0\n']): @@ -124,6 +129,7 @@ def run_test(self): self.test_config_file_parser() + self.test_invalid_command_line_options() # Remove the -datadir argument so it doesn't override the config file self.nodes[0].args = [arg for arg in self.nodes[0].args if not arg.startswith("-datadir")]