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

Function no_upfront_shutdown_script

openingd/common.c:169–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169u8 *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
197bool anchors_negotiated(struct feature_set *our_features,
198 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