We maintain channel_id matching for subds by snooping: we set it manually * for first packet (open_channel or open_channel2). */
| 921 | /* We maintain channel_id matching for subds by snooping: we set it manually |
| 922 | * for first packet (open_channel or open_channel2). */ |
| 923 | static 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 | |
| 942 | static struct io_plan *write_to_peer(struct io_conn *peer_conn, |
| 943 | struct peer *peer) |
no test coverage detected