MCPcopy Create free account
hub / github.com/ElementsProject/lightning / no_upfront_shutdown_script

Function no_upfront_shutdown_script

openingd/common.c:231–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231u8 *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
259bool anchors_negotiated(struct feature_set *our_features,
260 const u8 *their_features)

Callers 4

funder_channel_startFunction · 0.85
fundee_channelFunction · 0.85
accepter_startFunction · 0.85
opener_startFunction · 0.85

Calls 2

tal_hexdataFunction · 0.85
feature_negotiatedFunction · 0.85

Tested by

no test coverage detected