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

Function openchannel_init_after_sync

lightningd/dual_open_control.c:3161–3190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3159};
3160
3161static void openchannel_init_after_sync(struct chain_topology *topo,
3162 struct openchannel_init_info *info)
3163{
3164 struct peer *peer;
3165
3166 /* Look up peer again in case it's gone! */
3167 peer = peer_by_id(info->cmd->ld, info->id);
3168 if (!peer) {
3169 was_pending(command_fail(info->cmd, FUNDING_UNKNOWN_PEER, "Unknown peer"));
3170 return;
3171 }
3172
3173 if (!feature_negotiated(info->cmd->ld->our_features,
3174 peer->their_features,
3175 OPT_DUAL_FUND)) {
3176 was_pending(command_fail(info->cmd, FUNDING_V2_NOT_SUPPORTED,
3177 "v2 openchannel not supported "
3178 "by peer"));
3179 return;
3180 }
3181
3182 openchannel_init(info->cmd, peer,
3183 *info->amount,
3184 *info->request_amt,
3185 info->psbt,
3186 *info->feerate_per_kw_funding, *info->feerate_per_kw,
3187 info->our_upfront_shutdown_script,
3188 *info->announce_channel,
3189 info->rates, info->ctype);
3190}
3191
3192static struct command_result *json_openchannel_init(struct command *cmd,
3193 const char *buffer,

Callers

nothing calls this directly

Calls 5

peer_by_idFunction · 0.85
feature_negotiatedFunction · 0.85
was_pendingFunction · 0.70
command_failFunction · 0.70
openchannel_initFunction · 0.70

Tested by

no test coverage detected