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

Function read_hdr_from_peer

connectd/multiplex.c:1170–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1168}
1169
1170static struct io_plan *read_hdr_from_peer(struct io_conn *peer_conn,
1171 struct peer *peer)
1172{
1173 assert(peer->to_peer == peer_conn);
1174
1175 /* BOLT #8:
1176 *
1177 * ### Receiving and Decrypting Messages
1178 *
1179 * In order to decrypt the _next_ message in the network
1180 * stream, the following steps are completed:
1181 *
1182 * 1. Read _exactly_ 18 bytes from the network buffer.
1183 */
1184 peer->peer_in = tal_arr(peer, u8, CRYPTOMSG_HDR_SIZE);
1185 return io_read(peer_conn, peer->peer_in, CRYPTOMSG_HDR_SIZE,
1186 read_body_from_peer, peer);
1187}
1188
1189static struct io_plan *subd_conn_init(struct io_conn *subd_conn,
1190 struct subd *subd)

Callers 2

read_body_from_peer_doneFunction · 0.85
multiplex_peer_setupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected