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

Function no_upfront_shutdown_script

openingd/common.c:186–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186u8 *no_upfront_shutdown_script(const tal_t *ctx,
187 struct feature_set *our_features,
188 const u8 *their_features)
189{
190#if DEVELOPER
191 /* This is a hack, for feature testing */
192 const char *e = getenv("DEV_OPENINGD_UPFRONT_SHUTDOWN_SCRIPT");
193 if (e)
194 return tal_hexdata(ctx, e, strlen(e));
195#endif
196
197 /* BOLT #2:
198 *
199 * - if both nodes advertised the `option_upfront_shutdown_script`
200 * feature:
201 * - MUST include `upfront_shutdown_script` with either a valid
202 * `shutdown_scriptpubkey` as required by `shutdown`
203 * `scriptpubkey`, or a zero-length `shutdown_scriptpubkey`
204 * (ie. `0x0000`).
205 */
206 if (feature_negotiated(our_features, their_features,
207 OPT_UPFRONT_SHUTDOWN_SCRIPT))
208 return tal_arr(ctx, u8, 0);
209
210 return NULL;
211}
212
213void validate_initial_commitment_signature(int hsm_fd,
214 struct bitcoin_tx *tx,

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.50

Tested by

no test coverage detected