| 1118 | }; |
| 1119 | |
| 1120 | static void check_config(struct lightningd *ld) |
| 1121 | { |
| 1122 | /* BOLT #2: |
| 1123 | * |
| 1124 | * The receiving node MUST fail the channel if: |
| 1125 | *... |
| 1126 | * - `max_accepted_htlcs` is greater than 483. |
| 1127 | */ |
| 1128 | if (ld->config.max_concurrent_htlcs < 1 || ld->config.max_concurrent_htlcs > 483) |
| 1129 | fatal("--max-concurrent-htlcs value must be between 1 and 483 it is: %u", |
| 1130 | ld->config.max_concurrent_htlcs); |
| 1131 | if (ld->config.funding_confirms == 0) |
| 1132 | fatal("funding-confirms must be greater than zero"); |
| 1133 | |
| 1134 | if (ld->always_use_proxy && !ld->proxyaddr) |
| 1135 | fatal("--always-use-proxy needs --proxy"); |
| 1136 | |
| 1137 | if (ld->daemon_parent_fd != -1 && !ld->logfiles) |
| 1138 | fatal("--daemon needs --log-file"); |
| 1139 | } |
| 1140 | |
| 1141 | static char *test_subdaemons_and_exit(struct lightningd *ld) |
| 1142 | { |