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

Function handle_channel_locked

lightningd/dual_open_control.c:1730–1768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1728}
1729
1730static void handle_channel_locked(struct subd *dualopend,
1731 const int *fds,
1732 const u8 *msg)
1733{
1734 struct channel *channel = dualopend->channel;
1735 struct peer_fd *peer_fd;
1736
1737 if (!fromwire_dualopend_channel_locked(msg)) {
1738 channel_internal_error(channel,
1739 "Bad WIRE_DUALOPEND_CHANNEL_LOCKED: %s",
1740 tal_hex(msg, msg));
1741 return;
1742 }
1743 peer_fd = new_peer_fd_arr(tmpctx, fds);
1744
1745 assert(channel->scid);
1746 assert(channel->remote_channel_ready);
1747
1748 /* This can happen if we missed their sigs, for some reason */
1749 if (channel->state != DUALOPEND_AWAITING_LOCKIN)
1750 log_debug(channel->log, "Lockin complete, but state %s",
1751 channel_state_name(channel));
1752
1753 channel_set_state(channel,
1754 channel->state,
1755 CHANNELD_NORMAL,
1756 REASON_UNKNOWN,
1757 "Lockin complete");
1758 channel_record_open(channel,
1759 short_channel_id_blocknum(channel->scid),
1760 true);
1761
1762 /* Empty out the inflights */
1763 wallet_channel_clear_inflights(dualopend->ld->wallet, channel);
1764
1765 /* FIXME: LND sigs/update_fee msgs? */
1766 peer_start_channeld(channel, peer_fd, NULL, false, NULL);
1767 return;
1768}
1769
1770void dualopen_tell_depth(struct subd *dualopend,
1771 struct channel *channel,

Callers 1

dual_opend_msgFunction · 0.85

Calls 9

tal_hexFunction · 0.85
channel_set_stateFunction · 0.85
channel_record_openFunction · 0.85
channel_internal_errorFunction · 0.70
new_peer_fd_arrFunction · 0.70
channel_state_nameFunction · 0.70
peer_start_channeldFunction · 0.70

Tested by

no test coverage detected