| 943 | } |
| 944 | |
| 945 | bool AppInitParameterInteraction(const ArgsManager& args) |
| 946 | { |
| 947 | const CChainParams& chainparams = Params(); |
| 948 | // ********************************************************* Step 2: parameter interactions |
| 949 | |
| 950 | // also see: InitParameterInteraction() |
| 951 | |
| 952 | // We removed checkpoints but keep the option to warn users who still have it in their config. |
| 953 | if (args.IsArgSet("-checkpoints")) { |
| 954 | InitWarning(_("Option '-checkpoints' is set but checkpoints were removed. This option has no effect.")); |
| 955 | } |
| 956 | if (args.IsArgSet("-limitancestorsize")) { |
| 957 | InitWarning(_("Option '-limitancestorsize' is given but ancestor size limits have been replaced with cluster size limits (see -limitclustersize). This option has no effect.")); |
| 958 | } |
| 959 | if (args.IsArgSet("-limitdescendantsize")) { |
| 960 | InitWarning(_("Option '-limitdescendantsize' is given but descendant size limits have been replaced with cluster size limits (see -limitclustersize). This option has no effect.")); |
| 961 | } |
| 962 | |
| 963 | // Error if network-specific options (-addnode, -connect, etc) are |
| 964 | // specified in default section of config file, but not overridden |
| 965 | // on the command line or in this chain's section of the config file. |
| 966 | ChainType chain = args.GetChainType(); |
| 967 | if (chain == ChainType::SIGNET) { |
| 968 | LogInfo("Signet derived magic (message start): %s", HexStr(chainparams.MessageStart())); |
| 969 | } |
| 970 | bilingual_str errors; |
| 971 | for (const auto& arg : args.GetUnsuitableSectionOnlyArgs()) { |
| 972 | errors += strprintf(_("Config setting for %s only applied on %s network when in [%s] section."), arg, ChainTypeToString(chain), ChainTypeToString(chain)) + Untranslated("\n"); |
| 973 | } |
| 974 | |
| 975 | if (!errors.empty()) { |
| 976 | return InitError(errors); |
| 977 | } |
| 978 | |
| 979 | // Testnet3 deprecation warning |
| 980 | if (chain == ChainType::TESTNET) { |
| 981 | LogInfo("Warning: Support for testnet3 is deprecated and will be removed in an upcoming release. Consider switching to testnet4.\n"); |
| 982 | } |
| 983 | |
| 984 | // Warn if unrecognized section name are present in the config file. |
| 985 | bilingual_str warnings; |
| 986 | for (const auto& section : args.GetUnrecognizedSections()) { |
| 987 | warnings += Untranslated(strprintf("%s:%i ", section.m_file, section.m_line)) + strprintf(_("Section [%s] is not recognized."), section.m_name) + Untranslated("\n"); |
| 988 | } |
| 989 | |
| 990 | if (!warnings.empty()) { |
| 991 | InitWarning(warnings); |
| 992 | } |
| 993 | |
| 994 | if (!fs::is_directory(args.GetBlocksDirPath())) { |
| 995 | return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist."), args.GetArg("-blocksdir", ""))); |
| 996 | } |
| 997 | |
| 998 | // parse and validate enabled filter types |
| 999 | std::string blockfilterindex_value = args.GetArg("-blockfilterindex", DEFAULT_BLOCKFILTERINDEX); |
| 1000 | if (blockfilterindex_value == "" || blockfilterindex_value == "1") { |
| 1001 | g_enabled_filter_types = AllBlockFilterTypes(); |
| 1002 | } else if (blockfilterindex_value != "0") { |