| 149 | } |
| 150 | |
| 151 | bool UseMultiprocess(const CommandLine& cmd) |
| 152 | { |
| 153 | // If -m or -M options were explicitly specified, there is no need to |
| 154 | // further parse arguments to determine which to use. |
| 155 | if (cmd.use_multiprocess) return *cmd.use_multiprocess; |
| 156 | |
| 157 | ArgsManager args; |
| 158 | args.SetDefaultFlags(ArgsManager::ALLOW_ANY); |
| 159 | std::string error_message; |
| 160 | auto argv{cmd.args}; |
| 161 | argv.insert(argv.begin(), nullptr); |
| 162 | if (!args.ParseParameters(argv.size(), argv.data(), error_message)) { |
| 163 | tfm::format(std::cerr, "Warning: failed to parse subcommand command line options: %s\n", error_message); |
| 164 | } |
| 165 | if (!args.ReadConfigFiles(error_message, true)) { |
| 166 | tfm::format(std::cerr, "Warning: failed to parse subcommand config: %s\n", error_message); |
| 167 | } |
| 168 | args.SelectConfigNetwork(args.GetChainTypeString()); |
| 169 | |
| 170 | // If any -ipc* options are set these need to be processed by a |
| 171 | // multiprocess-capable binary. |
| 172 | return args.IsArgSet("-ipcbind") || args.IsArgSet("-ipcconnect") || args.IsArgSet("-ipcfd"); |
| 173 | } |
| 174 | |
| 175 | //! Execute the specified bitcoind, bitcoin-qt or other command line in `args` |
| 176 | //! using src, bin and libexec directory paths relative to this executable, where |
no test coverage detected