| 368 | } |
| 369 | |
| 370 | static void opening_funder_finished(struct subd *openingd, const u8 *resp, |
| 371 | const int *fds, |
| 372 | struct funding_channel *fc) |
| 373 | { |
| 374 | struct channel_info channel_info; |
| 375 | struct channel_id cid; |
| 376 | struct bitcoin_outpoint funding; |
| 377 | struct bitcoin_signature remote_commit_sig; |
| 378 | struct bitcoin_tx *remote_commit; |
| 379 | u32 feerate; |
| 380 | struct channel *channel; |
| 381 | struct lightningd *ld = openingd->ld; |
| 382 | u8 *remote_upfront_shutdown_script; |
| 383 | struct peer_fd *peer_fd; |
| 384 | struct penalty_base *pbase; |
| 385 | struct channel_type *type; |
| 386 | bool was_important; |
| 387 | |
| 388 | /* This is a new channel_info.their_config so set its ID to 0 */ |
| 389 | channel_info.their_config.id = 0; |
| 390 | |
| 391 | if (!fromwire_openingd_funder_reply(resp, resp, |
| 392 | &channel_info.their_config, |
| 393 | &remote_commit, |
| 394 | &pbase, |
| 395 | &remote_commit_sig, |
| 396 | &channel_info.theirbase.revocation, |
| 397 | &channel_info.theirbase.payment, |
| 398 | &channel_info.theirbase.htlc, |
| 399 | &channel_info.theirbase.delayed_payment, |
| 400 | &channel_info.remote_per_commit, |
| 401 | &fc->uc->minimum_depth, |
| 402 | &channel_info.remote_fundingkey, |
| 403 | &funding, |
| 404 | &feerate, |
| 405 | &fc->uc->our_config.channel_reserve, |
| 406 | &remote_upfront_shutdown_script, |
| 407 | &type)) { |
| 408 | log_broken(fc->uc->log, |
| 409 | "bad OPENING_FUNDER_REPLY %s", |
| 410 | tal_hex(resp, resp)); |
| 411 | was_pending(command_fail(fc->cmd, LIGHTNINGD, |
| 412 | "bad OPENING_FUNDER_REPLY %s", |
| 413 | tal_hex(fc->cmd, resp))); |
| 414 | goto cleanup; |
| 415 | } |
| 416 | remote_commit->chainparams = chainparams; |
| 417 | |
| 418 | peer_fd = new_peer_fd_arr(resp, fds); |
| 419 | |
| 420 | log_debug(ld->log, |
| 421 | "%s", fmt_pubkey(tmpctx, |
| 422 | &channel_info.remote_per_commit)); |
| 423 | |
| 424 | /* Saved with channel to disk */ |
| 425 | derive_channel_id(&cid, &funding); |
| 426 | |
| 427 | /* old_remote_per_commit not valid yet, copy valid one. */ |
no test coverage detected