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

Function maybe_update_channelid

connectd/multiplex.c:923–940  ·  view source on GitHub ↗

We maintain channel_id matching for subds by snooping: we set it manually * for first packet (open_channel or open_channel2). */

Source from the content-addressed store, hash-verified

921/* We maintain channel_id matching for subds by snooping: we set it manually
922 * for first packet (open_channel or open_channel2). */
923static void maybe_update_channelid(struct subd *subd, const u8 *msg)
924{
925 switch (fromwire_peektype(msg)) {
926 case WIRE_OPEN_CHANNEL:
927 extract_channel_id(msg, &subd->channel_id);
928 break;
929 case WIRE_OPEN_CHANNEL2:
930 subd->opener_revocation_basepoint
931 = extract_revocation_basepoint(subd, msg);
932 break;
933 case WIRE_ACCEPT_CHANNEL2:
934 update_v2_channelid(subd, msg);
935 break;
936 case WIRE_FUNDING_CREATED:
937 update_v1_channelid(subd, msg);
938 break;
939 }
940}
941
942static struct io_plan *write_to_peer(struct io_conn *peer_conn,
943 struct peer *peer)

Callers 2

read_from_subd_doneFunction · 0.85
read_body_from_peer_doneFunction · 0.85

Calls 5

extract_channel_idFunction · 0.85
update_v2_channelidFunction · 0.85
update_v1_channelidFunction · 0.85
fromwire_peektypeFunction · 0.50

Tested by

no test coverage detected