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

Function openchannel_init_after_sync

lightningd/dual_open_control.c:3402–3431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3400};
3401
3402static void openchannel_init_after_sync(struct chain_topology *topo,
3403 struct openchannel_init_info *info)
3404{
3405 struct peer *peer;
3406
3407 /* Look up peer again in case it's gone! */
3408 peer = peer_by_id(info->cmd->ld, info->id);
3409 if (!peer) {
3410 was_pending(command_fail(info->cmd, FUNDING_UNKNOWN_PEER, "Unknown peer"));
3411 return;
3412 }
3413
3414 if (!feature_negotiated(info->cmd->ld->our_features,
3415 peer->their_features,
3416 OPT_DUAL_FUND)) {
3417 was_pending(command_fail(info->cmd, FUNDING_V2_NOT_SUPPORTED,
3418 "v2 openchannel not supported "
3419 "by peer"));
3420 return;
3421 }
3422
3423 openchannel_init(info->cmd, peer,
3424 *info->amount,
3425 *info->request_amt,
3426 info->psbt,
3427 *info->feerate_per_kw_funding, *info->feerate_per_kw,
3428 info->our_upfront_shutdown_script,
3429 *info->announce_channel,
3430 info->rates, info->ctype);
3431}
3432
3433static struct command_result *json_openchannel_init(struct command *cmd,
3434 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