mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 8aa6178961 into merged_master (Bitcoin PR #20003)
This commit is contained in:
commit
64bfdd9af8
2 changed files with 11 additions and 0 deletions
|
|
@ -1231,6 +1231,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=<ip> or -proxy=<ip:port>."));
|
||||
}
|
||||
|
||||
try {
|
||||
const std::string default_asset_name = gArgs.GetArg("-defaultpeggedassetname", "bitcoin");
|
||||
InitGlobalAssetDir(gArgs.GetArgs("-assetdir"), default_asset_name);
|
||||
|
|
|
|||
|
|
@ -80,6 +80,12 @@ class ConfArgsTest(BitcoinTestFramework):
|
|||
with open(inc_conf_file_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=<ip> or -proxy=<ip:port>.',
|
||||
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']):
|
||||
self.start_node(0, extra_args=['-noconnect=0'])
|
||||
|
|
@ -148,6 +154,7 @@ class ConfArgsTest(BitcoinTestFramework):
|
|||
self.test_networkactive()
|
||||
|
||||
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")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue