| 3159 | }; |
| 3160 | |
| 3161 | static 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 | |
| 3192 | static struct command_result *json_openchannel_init(struct command *cmd, |
| 3193 | const char *buffer, |
nothing calls this directly
no test coverage detected