network is NULL for parsing top-level config file. */
| 251 | |
| 252 | /* network is NULL for parsing top-level config file. */ |
| 253 | static void parse_implied_config_file(const char *config_basedir, |
| 254 | const char *network, |
| 255 | bool early) |
| 256 | { |
| 257 | const char *dir, *filename; |
| 258 | |
| 259 | if (config_basedir) |
| 260 | dir = path_join(NULL, take(path_cwd(NULL)), config_basedir); |
| 261 | else |
| 262 | dir = default_base_configdir(NULL); |
| 263 | |
| 264 | if (network) |
| 265 | dir = path_join(NULL, take(dir), network); |
| 266 | |
| 267 | filename = path_join(NULL, take(dir), "config"); |
| 268 | parse_include(filename, false, early, 0); |
| 269 | tal_free(filename); |
| 270 | } |
| 271 | |
| 272 | /* If they specify --conf, we just read that. |
| 273 | * Otherwise we read <lightning-dir>/config then <lightning-dir>/<network>/config |
no test coverage detected