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

Function handle_funding_depth

openingd/dualopend.c:3441–3463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3439}
3440
3441static u8 *handle_funding_depth(struct state *state, u8 *msg)
3442{
3443 u32 depth;
3444
3445 if (!fromwire_dualopend_depth_reached(msg, &depth))
3446 master_badmsg(WIRE_DUALOPEND_DEPTH_REACHED, msg);
3447
3448 /* Too late, shutting down already */
3449 if (state->shutdown_sent[LOCAL])
3450 return NULL;
3451
3452 /* We check this before we arrive here, but for sanity */
3453 assert(state->minimum_depth <= depth);
3454
3455 /* Tell gossipd the new channel exists before we tell peer. */
3456 tell_gossipd_new_channel(state);
3457
3458 send_channel_ready(state);
3459 if (state->channel_ready[REMOTE])
3460 return towire_dualopend_channel_locked(state);
3461
3462 return NULL;
3463}
3464
3465/* BOLT #2:
3466 *

Callers 1

handle_master_inFunction · 0.70

Calls 3

tell_gossipd_new_channelFunction · 0.85
send_channel_readyFunction · 0.85
master_badmsgFunction · 0.50

Tested by

no test coverage detected