| 229 | } |
| 230 | |
| 231 | u8 *no_upfront_shutdown_script(const tal_t *ctx, |
| 232 | bool developer, |
| 233 | struct feature_set *our_features, |
| 234 | const u8 *their_features) |
| 235 | { |
| 236 | if (developer) { |
| 237 | /* This is a hack, for feature testing */ |
| 238 | const char *e = getenv("DEV_OPENINGD_UPFRONT_SHUTDOWN_SCRIPT"); |
| 239 | if (e) |
| 240 | return tal_hexdata(ctx, e, strlen(e)); |
| 241 | } |
| 242 | |
| 243 | /* BOLT #2: |
| 244 | * |
| 245 | * - if both nodes advertised the `option_upfront_shutdown_script` |
| 246 | * feature: |
| 247 | * - MUST include `upfront_shutdown_script` with either a valid |
| 248 | * `shutdown_scriptpubkey` as required by `shutdown` |
| 249 | * `scriptpubkey`, or a zero-length `shutdown_scriptpubkey` |
| 250 | * (ie. `0x0000`). |
| 251 | */ |
| 252 | if (feature_negotiated(our_features, their_features, |
| 253 | OPT_UPFRONT_SHUTDOWN_SCRIPT)) |
| 254 | return tal_arr(ctx, u8, 0); |
| 255 | |
| 256 | return NULL; |
| 257 | } |
| 258 | |
| 259 | bool anchors_negotiated(struct feature_set *our_features, |
| 260 | const u8 *their_features) |
no test coverage detected