| 167 | } |
| 168 | |
| 169 | u8 *no_upfront_shutdown_script(const tal_t *ctx, |
| 170 | bool developer, |
| 171 | struct feature_set *our_features, |
| 172 | const u8 *their_features) |
| 173 | { |
| 174 | if (developer) { |
| 175 | /* This is a hack, for feature testing */ |
| 176 | const char *e = getenv("DEV_OPENINGD_UPFRONT_SHUTDOWN_SCRIPT"); |
| 177 | if (e) |
| 178 | return tal_hexdata(ctx, e, strlen(e)); |
| 179 | } |
| 180 | |
| 181 | /* BOLT #2: |
| 182 | * |
| 183 | * - if both nodes advertised the `option_upfront_shutdown_script` |
| 184 | * feature: |
| 185 | * - MUST include `upfront_shutdown_script` with either a valid |
| 186 | * `shutdown_scriptpubkey` as required by `shutdown` |
| 187 | * `scriptpubkey`, or a zero-length `shutdown_scriptpubkey` |
| 188 | * (ie. `0x0000`). |
| 189 | */ |
| 190 | if (feature_negotiated(our_features, their_features, |
| 191 | OPT_UPFRONT_SHUTDOWN_SCRIPT)) |
| 192 | return tal_arr(ctx, u8, 0); |
| 193 | |
| 194 | return NULL; |
| 195 | } |
| 196 | |
| 197 | bool anchors_negotiated(struct feature_set *our_features, |
| 198 | const u8 *their_features) |
no test coverage detected